mirror of
https://github.com/gryf/pywmtemp.git
synced 2025-12-17 19:20:18 +01:00
Added guard for unlabeled sensors
This commit is contained in:
@@ -230,6 +230,12 @@ class SensorDockApp(wmdocklib.DockApp):
|
||||
temp = None
|
||||
temps = psutil.sensors_temperatures()
|
||||
for shw in temps.get(item.get('sensor'), []):
|
||||
# if there is no label configured, take the first sensor
|
||||
# temperature.
|
||||
if not item.get('label'):
|
||||
temp = shw
|
||||
break
|
||||
|
||||
if shw.label == item.get('label'):
|
||||
temp = shw
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user