diff --git a/custom_components/versatile_thermostat/base_thermostat.py b/custom_components/versatile_thermostat/base_thermostat.py index 3b03492..c8f1274 100644 --- a/custom_components/versatile_thermostat/base_thermostat.py +++ b/custom_components/versatile_thermostat/base_thermostat.py @@ -173,6 +173,7 @@ class BaseThermostat(ClimateEntity, RestoreEntity): "timezone", "window_sensor_entity_id", "window_delay_sec", + "window_auto_enabled", "window_auto_open_threshold", "window_auto_close_threshold", "window_auto_max_duration", @@ -2207,6 +2208,7 @@ class BaseThermostat(ClimateEntity, RestoreEntity): "timezone": str(self._current_tz), "window_sensor_entity_id": self._window_sensor_entity_id, "window_delay_sec": self._window_delay_sec, + "window_auto_enabled": self.is_window_auto_enabled, "window_auto_open_threshold": self._window_auto_open_threshold, "window_auto_close_threshold": self._window_auto_close_threshold, "window_auto_max_duration": self._window_auto_max_duration, diff --git a/custom_components/versatile_thermostat/config_flow.py b/custom_components/versatile_thermostat/config_flow.py index f944bc8..3b6b9cd 100644 --- a/custom_components/versatile_thermostat/config_flow.py +++ b/custom_components/versatile_thermostat/config_flow.py @@ -265,12 +265,16 @@ class VersatileThermostatBaseConfigFlow(FlowHandler): CONF_AUTO_REGULATION_MODE, default=CONF_AUTO_REGULATION_NONE ): selector.SelectSelector( selector.SelectSelectorConfig( - options=CONF_AUTO_REGULATION_MODES, translation_key="auto_regulation_mode" + options=CONF_AUTO_REGULATION_MODES, + translation_key="auto_regulation_mode", ) ), - vol.Optional(CONF_AUTO_REGULATION_DTEMP, default=0.5): vol.Coerce(float), - vol.Optional(CONF_AUTO_REGULATION_PERIOD_MIN, default=5): cv.positive_int - + vol.Optional(CONF_AUTO_REGULATION_DTEMP, default=0.5): vol.Coerce( + float + ), + vol.Optional( + CONF_AUTO_REGULATION_PERIOD_MIN, default=5 + ): cv.positive_int, } ) @@ -862,6 +866,9 @@ class VersatileThermostatOptionsFlowHandler( """Finalization of the ConfigEntry creation""" if not self._infos[CONF_USE_WINDOW_FEATURE]: self._infos[CONF_WINDOW_SENSOR] = None + self._infos[CONF_WINDOW_AUTO_CLOSE_THRESHOLD] = None + self._infos[CONF_WINDOW_AUTO_OPEN_THRESHOLD] = None + self._infos[CONF_WINDOW_AUTO_MAX_DURATION] = None if not self._infos[CONF_USE_MOTION_FEATURE]: self._infos[CONF_MOTION_SENSOR] = None if not self._infos[CONF_USE_POWER_FEATURE]: