All developped and tests ok

This commit is contained in:
Jean-Marc Collin
2024-03-10 17:59:43 +00:00
parent 7fbdc2f0b8
commit ee432dd5cd
9 changed files with 428 additions and 133 deletions

View File

@@ -318,7 +318,6 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
if cfg.get(CONF_USE_TPI_CENTRAL_CONFIG) is True:
clean_one(cfg, STEP_CENTRAL_TPI_DATA_SCHEMA)
if cfg.get(CONF_USE_WINDOW_CENTRAL_CONFIG) is True:
clean_one(cfg, STEP_CENTRAL_WINDOW_DATA_SCHEMA)
@@ -436,7 +435,10 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
self._presence_sensor_entity_id = entry_infos.get(CONF_PRESENCE_SENSOR)
self._power_temp = entry_infos.get(CONF_PRESET_POWER)
self._presence_on = self._presence_sensor_entity_id is not None
self._presence_on = (
entry_infos.get(CONF_USE_PRESENCE_FEATURE, False)
and self._presence_sensor_entity_id is not None
)
if self._ac_mode:
# Added by https://github.com/jmcollin78/versatile_thermostat/pull/144
@@ -1339,6 +1341,7 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
temp_val = self._presets.get(preset_mode, 0)
if not self._presence_on or self._presence_state in [
None,
STATE_ON,
STATE_HOME,
]:

View File

@@ -129,7 +129,9 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
):
if not is_empty:
current_config = self._infos.get(config, None)
self._infos[config] = current_config is True or current_config is None
self._infos[config] = current_config is True or (
current_config is None and self._central_config is not None
)
else:
self._infos[config] = self._central_config is not None
@@ -260,6 +262,12 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
):
return False
if (
infos.get(CONF_USE_ADVANCED_CENTRAL_CONFIG, False) is False
and infos.get(CONF_MINIMAL_ACTIVATION_DELAY, -1) == -1
):
return False
return True
def merge_user_input(self, data_schema: vol.Schema, user_input: dict):