You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def _fetch_cputemp(self): - line 583 in sensors.py
It is trying to find the temperature via /sys/class/thermal/thermal_zone0/temp
and as a fallback via /sys/class/hwmon/
So the former should be defined by the linux kernel - it would be interesting to navigate to /sys/class/thermal ... and see if the temperature is defined in a slightly different file name/folder-name
Yeah - the function should not return a None - it will only do so when both fallbacks fail. So the final ret statement should check if None and instead return a zero number
Hi!
When the output of
_fetch_VARIABLENAME()
isNone
, there's no__format__
and you geterrors like
non-empty format string passed to object.__format__
E.g. in may case, in class CPUTemp,
fomat(self._fetch_cputemp())
(in sensors.py ln 581) generatesa runtime error of that kind.
I changed the line above to
return "{!s:2s}\u00B0C".format(self._fetch_cputemp())
to force formatting the output of
_fetch_cputemp
to a str obj. Not very pretty but works as a quick fix.I don't even know if this is the best way to do it! ahahah
About why I get
None
, this is a mystery. When I first apt installed it, it was reading the cputemp,after reboot it doesn't anymore. I have a dual Xeon W5580. On my laptop it works perfectly.
Any advice is strongly welcome! Tnx!
Dan
The text was updated successfully, but these errors were encountered: