From 62a5e05a7ac9e5aa1c664baba19a05bda90f949f Mon Sep 17 00:00:00 2001 From: Jean-Marc Collin Date: Sat, 7 Jan 2023 18:30:46 +0100 Subject: [PATCH] FIX power management not intialized --- custom_components/versatile_thermostat/climate.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/custom_components/versatile_thermostat/climate.py b/custom_components/versatile_thermostat/climate.py index 479ec04..268eea8 100644 --- a/custom_components/versatile_thermostat/climate.py +++ b/custom_components/versatile_thermostat/climate.py @@ -248,16 +248,17 @@ class VersatileThermostat(ClimateEntity, RestoreEntity): # 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