Skip to content

Commit

Permalink
FIX power management not intialized
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Marc Collin committed Jan 7, 2023
1 parent a6a5fd3 commit 62a5e05
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions custom_components/versatile_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,17 @@ def __init__(

# Power management
self._device_power = device_power
self._pmax_on = False
self._current_power = None
self._current_power_max = None
if (
self._max_power_sensor_entity_id
and self._power_sensor_entity_id
and self._device_power
):
self._pmax_on = True
self._current_power = -1
self._current_power_max = -1
else:
self._pmax_on = False
self._current_power = 0
self._current_power_max = 0

# will be restored if possible
self._target_temp = None
Expand Down

0 comments on commit 62a5e05

Please sign in to comment.