temperature_store: remove stale temperature sensors from the "last_temps" dict
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
4191aac63f
commit
d768a30d47
|
@ -63,6 +63,10 @@ class TemperatureStore:
|
||||||
'temperatures': deque(maxlen=TEMPERATURE_STORE_SIZE),
|
'temperatures': deque(maxlen=TEMPERATURE_STORE_SIZE),
|
||||||
'targets': deque(maxlen=TEMPERATURE_STORE_SIZE)}
|
'targets': deque(maxlen=TEMPERATURE_STORE_SIZE)}
|
||||||
self.temperature_store = new_store
|
self.temperature_store = new_store
|
||||||
|
# Prune unconfigured sensors in self.last_temps
|
||||||
|
for sensor in list(self.last_temps.keys()):
|
||||||
|
if sensor not in self.temperature_store:
|
||||||
|
del self.last_temps[sensor]
|
||||||
self.temp_update_cb.start()
|
self.temp_update_cb.start()
|
||||||
else:
|
else:
|
||||||
logging.info("No sensors found")
|
logging.info("No sensors found")
|
||||||
|
|
Loading…
Reference in New Issue