mirror of
https://github.com/gryf/pywmtemp.git
synced 2025-12-18 11:40:17 +01:00
Added guard for unlabeled sensors
This commit is contained in:
@@ -230,6 +230,12 @@ class SensorDockApp(wmdocklib.DockApp):
|
|||||||
temp = None
|
temp = None
|
||||||
temps = psutil.sensors_temperatures()
|
temps = psutil.sensors_temperatures()
|
||||||
for shw in temps.get(item.get('sensor'), []):
|
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'):
|
if shw.label == item.get('label'):
|
||||||
temp = shw
|
temp = shw
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user