fix(sensor): fix rig temperature sensor state

- was short-circuiting after first device
- ignore inactive (-1) temperatures
This commit is contained in:
Brian Berg 2020-06-16 23:43:13 +00:00
parent 6c0a39e7c7
commit 2ef6ad9ac1

View File

@ -196,10 +196,10 @@ class NiceHashRigTemperatureSensor(Entity):
self._temps = []
for device in devices:
temp = int(device.get("temperature"))
self._temps.append(temp)
if temp < 0:
# Ignore inactive devices
continue
self._temps.append(temp)
if temp > highest_temp:
highest_temp = temp
return highest_temp