FIX #518 TypeError: unsupported operand type(s) for -: 'int' and 'NoneType' (#559)

Co-authored-by: Jean-Marc Collin <jean-marc.collin-extern@renault.com>
This commit is contained in:
Jean-Marc Collin
2024-10-14 19:29:34 +02:00
committed by GitHub
parent 4ef82af8ce
commit a530051bbd

View File

@@ -692,8 +692,9 @@ class ThermostatOverClimate(BaseThermostat[UnderlyingClimate]):
else None
)
last_sent_temperature = under.last_sent_temperature or 0
under_temp_diff = (
(new_target_temp - under.last_sent_temperature) if new_target_temp else 0
(new_target_temp - last_sent_temperature) if new_target_temp else 0
)
if -1 < under_temp_diff < 1:
under_temp_diff = 0