mirror of
https://github.com/gryf/pywmtemp.git
synced 2026-11-20 14:06:58 +01:00
Added guard for unlabeled sensors
This commit is contained in:
1 parent
6f805d8bdc
commit
7295d8123d
1 file changed
+6
@@ -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