Issue #189 - cannot remove window auto detection

This commit is contained in:
Jean-Marc Collin
2023-12-03 17:59:48 +00:00
parent fad1c4136a
commit 5df77a1f74
2 changed files with 13 additions and 4 deletions

View File

@@ -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,

View File

@@ -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]: