Skip to content

Commit

Permalink
FIX #518 TypeError: unsupported operand type(s) for -: 'int' and 'Non…
Browse files Browse the repository at this point in the history
…eType'
  • Loading branch information
Jean-Marc Collin committed Oct 14, 2024
1 parent 4ef82af commit eadd101
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/versatile_thermostat/thermostat_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,9 @@ async def end_climate_changed(changes: bool):
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
Expand Down

0 comments on commit eadd101

Please sign in to comment.