frobar: Display temperature for other CPU types
This commit is contained in:
parent
a3fcaf9d27
commit
d6d3df65df
|
@ -144,16 +144,20 @@ class RamProvider(AlertingSection, PeriodicUpdater):
|
|||
class TemperatureProvider(AlertingSection, PeriodicUpdater):
|
||||
NUMBER_STATES = 2
|
||||
RAMP = ""
|
||||
MAIN_TEMPS = ["coretemp", "amdgpu", "cpu_thermal"]
|
||||
# For Intel, AMD and ARM respectively.
|
||||
|
||||
def fetcher(self):
|
||||
allTemp = psutil.sensors_temperatures()
|
||||
if "coretemp" not in allTemp:
|
||||
# TODO Opti Remove interval
|
||||
return ""
|
||||
temp = allTemp["coretemp"][0]
|
||||
for main in self.MAIN_TEMPS:
|
||||
if main in allTemp:
|
||||
break
|
||||
else:
|
||||
return "?"
|
||||
temp = allTemp[main][0]
|
||||
|
||||
self.warningThresold = temp.high
|
||||
self.dangerThresold = temp.critical
|
||||
self.warningThresold = temp.high or 90.0
|
||||
self.dangerThresold = temp.critical or 100.0
|
||||
self.updateLevel(temp.current)
|
||||
|
||||
self.icon = Section.ramp(temp.current / temp.high, self.RAMP)
|
||||
|
|
Loading…
Reference in a new issue