From 8b58e69755780a0109b19fca6bb19d49d32a1e78 Mon Sep 17 00:00:00 2001 From: Jean-Marc Collin Date: Sun, 5 Jan 2025 10:53:28 +0000 Subject: [PATCH] Fix restore overpowering_state --- custom_components/versatile_thermostat/base_thermostat.py | 1 - .../versatile_thermostat/feature_power_manager.py | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/custom_components/versatile_thermostat/base_thermostat.py b/custom_components/versatile_thermostat/base_thermostat.py index fc63336..4dc4c25 100644 --- a/custom_components/versatile_thermostat/base_thermostat.py +++ b/custom_components/versatile_thermostat/base_thermostat.py @@ -98,7 +98,6 @@ class BaseThermostat(ClimateEntity, RestoreEntity, Generic[T]): "comfort_away_temp", "power_temp", "ac_mode", - "current_max_power", "saved_preset_mode", "saved_target_temp", "saved_hvac_mode", diff --git a/custom_components/versatile_thermostat/feature_power_manager.py b/custom_components/versatile_thermostat/feature_power_manager.py index 05fcca5..8642d78 100644 --- a/custom_components/versatile_thermostat/feature_power_manager.py +++ b/custom_components/versatile_thermostat/feature_power_manager.py @@ -71,11 +71,7 @@ class FeaturePowerManager(BaseFeatureManager): self._is_configured = True # Try to restore _overpowering_state from previous state old_state = await self._vtherm.async_get_last_state() - self._overpowering_state = ( - old_state.attributes.get("overpowering_state", STATE_UNKNOWN) - if old_state and old_state.attributes and old_state.attributes in (STATE_OFF, STATE_ON) - else STATE_UNKNOWN - ) + self._overpowering_state = STATE_ON if old_state and old_state.attributes and old_state.attributes.get("overpowering_state") == STATE_ON else STATE_UNKNOWN else: if self._use_power_feature: if not central_power_configuration: