With new menu. Testus KO

This commit is contained in:
Jean-Marc Collin
2024-03-10 09:46:28 +00:00
parent 744bfdb9fe
commit 7fbdc2f0b8
10 changed files with 506 additions and 623 deletions

View File

@@ -318,9 +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_PRESETS_CENTRAL_CONFIG) is True:
clean_one(cfg, STEP_CENTRAL_PRESETS_DATA_SCHEMA)
clean_one(cfg, STEP_CENTRAL_PRESETS_WITH_AC_DATA_SCHEMA)
if cfg.get(CONF_USE_WINDOW_CENTRAL_CONFIG) is True:
clean_one(cfg, STEP_CENTRAL_WINDOW_DATA_SCHEMA)
@@ -2696,4 +2693,3 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
await self._async_set_preset_mode_internal(self._attr_preset_mode, True)
self.hass.create_task(self._check_initial_state())

View File

@@ -95,9 +95,9 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
self._init_feature_flags(infos)
self._init_central_config_flags(infos)
def _init_feature_flags(self, infos):
def _init_feature_flags(self, _):
"""Fix features selection depending to infos"""
is_empty: bool = not bool(infos)
is_empty: bool = False # TODO remove this not bool(infos)
self._infos[CONF_USE_WINDOW_FEATURE] = (
is_empty
or self._infos.get(CONF_WINDOW_SENSOR) is not None
@@ -128,7 +128,8 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
CONF_USE_ADVANCED_CENTRAL_CONFIG,
):
if not is_empty:
self._infos[config] = self._infos.get(config) is True
current_config = self._infos.get(config, None)
self._infos[config] = current_config is True or current_config is None
else:
self._infos[config] = self._central_config is not None
@@ -203,6 +204,64 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
except ServiceConfigurationError as err:
raise ServiceConfigurationError(conf) from err
def check_config_complete(self, infos) -> bool:
"""True if the config is now complete (ie all mandatory attributes are set)"""
if (
infos.get(CONF_NAME) is None
or infos.get(CONF_TEMP_SENSOR) is None
or infos.get(CONF_CYCLE_MIN) is None
):
return False
if (
infos.get(CONF_USE_MAIN_CENTRAL_CONFIG, False) is False
and infos.get(CONF_EXTERNAL_TEMP_SENSOR) is None
):
return False
if (
infos.get(CONF_THERMOSTAT_TYPE) == CONF_THERMOSTAT_SWITCH
and infos.get(CONF_HEATER, None) is None
):
return False
if (
infos.get(CONF_THERMOSTAT_TYPE) == CONF_THERMOSTAT_CLIMATE
and infos.get(CONF_CLIMATE, None) is None
):
return False
if (
infos.get(CONF_THERMOSTAT_TYPE) == CONF_THERMOSTAT_VALVE
and infos.get(CONF_VALVE, None) is None
):
return False
if (
infos.get(CONF_USE_MOTION_FEATURE, False) is True
and infos.get(CONF_MOTION_SENSOR, None) is None
):
return False
if (
infos.get(CONF_USE_POWER_FEATURE, False) is True
and infos.get(CONF_USE_POWER_CENTRAL_CONFIG, False) is False
and (
infos.get(CONF_POWER_SENSOR, None) is None
or infos.get(CONF_MAX_POWER_SENSOR, None) is None
)
):
return False
if (
infos.get(CONF_USE_PRESENCE_FEATURE, False) is True
and infos.get(CONF_USE_PRESENCE_CENTRAL_CONFIG, False) is False
and infos.get(CONF_PRESENCE_SENSOR, None) is None
):
return False
return True
def merge_user_input(self, data_schema: vol.Schema, user_input: dict):
"""For each schema entry not in user_input, set or remove values in infos"""
self._infos.update(user_input)
@@ -244,6 +303,8 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
errors["base"] = "unknown"
else:
self.merge_user_input(data_schema, user_input)
# Add default values for central config flags
self._init_central_config_flags(self._infos)
_LOGGER.debug("_info is now: %s", self._infos)
return await next_step_function()
@@ -264,30 +325,72 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
_LOGGER.debug("Into ConfigFlow.async_step_user user_input=%s", user_input)
return await self.generic_step(
"user", STEP_USER_DATA_SCHEMA, user_input, self.async_step_main
"user", STEP_USER_DATA_SCHEMA, user_input, self.async_step_menu
)
async def async_step_menu(self, user_input: dict | None = None) -> FlowResult:
"""Handle the flow steps"""
_LOGGER.debug("Into ConfigFlow.async_step_menu user_input=%s", user_input)
menu_options = ["main", "type"]
if self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_CENTRAL_CONFIG:
menu_options.append("central_boiler")
else:
menu_options.append("features")
if self._infos.get(CONF_PROP_FUNCTION) == PROPORTIONAL_FUNCTION_TPI:
menu_options.append("tpi")
if self._infos[CONF_THERMOSTAT_TYPE] in [
CONF_THERMOSTAT_SWITCH,
CONF_THERMOSTAT_VALVE,
CONF_THERMOSTAT_CLIMATE,
]:
menu_options.append("presets")
if self._infos[CONF_USE_WINDOW_FEATURE] is True:
menu_options.append("window")
if self._infos[CONF_USE_MOTION_FEATURE] is True:
menu_options.append("motion")
if self._infos[CONF_USE_POWER_FEATURE] is True:
menu_options.append("power")
if self._infos[CONF_USE_PRESENCE_FEATURE] is True:
menu_options.append("presence")
menu_options.append("advanced")
if self.check_config_complete(self._infos):
menu_options.append("finalize")
return self.async_show_menu(
step_id="menu",
menu_options=menu_options,
description_placeholders=self._placeholders,
)
async def async_step_main(self, user_input: dict | None = None) -> FlowResult:
"""Handle the flow steps"""
_LOGGER.debug("Into ConfigFlow.async_step_main user_input=%s", user_input)
schema = STEP_MAIN_DATA_SCHEMA
next_step = self.async_step_type
next_step = self.async_step_menu
if self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_CENTRAL_CONFIG:
self._infos[CONF_NAME] = CENTRAL_CONFIG_NAME
schema = STEP_CENTRAL_MAIN_DATA_SCHEMA
if user_input and user_input.get(CONF_ADD_CENTRAL_BOILER_CONTROL) is True:
next_step = self.async_step_central_boiler
else:
next_step = self.async_step_tpi
elif user_input and user_input.get(CONF_USE_MAIN_CENTRAL_CONFIG) is False:
next_step = self.async_step_spec_main
else:
schema = STEP_MAIN_DATA_SCHEMA
# If we come from async_step_spec_main
elif self._infos.get(COMES_FROM) == "async_step_spec_main":
next_step = self.async_step_type
schema = STEP_CENTRAL_MAIN_DATA_SCHEMA
if (
user_input
and user_input.get(CONF_USE_MAIN_CENTRAL_CONFIG, False) is False
):
if user_input and self._infos.get(COMES_FROM) == "async_step_spec_main":
schema = STEP_CENTRAL_MAIN_DATA_SCHEMA
del self._infos[COMES_FROM]
else:
next_step = self.async_step_spec_main
return await self.generic_step("main", schema, user_input, next_step)
@@ -299,7 +402,7 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
schema = STEP_CENTRAL_MAIN_DATA_SCHEMA
else:
schema = STEP_CENTRAL_SPEC_MAIN_DATA_SCHEMA
next_step = self.async_step_type
next_step = self.async_step_menu
self._infos[COMES_FROM] = "async_step_spec_main"
@@ -315,7 +418,7 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
)
schema = STEP_CENTRAL_BOILER_SCHEMA
next_step = self.async_step_tpi
next_step = self.async_step_menu
return await self.generic_step("central_boiler", schema, user_input, next_step)
@@ -325,36 +428,50 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
if self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_SWITCH:
return await self.generic_step(
"type", STEP_THERMOSTAT_SWITCH, user_input, self.async_step_tpi
"type", STEP_THERMOSTAT_SWITCH, user_input, self.async_step_menu
)
elif self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_VALVE:
return await self.generic_step(
"type", STEP_THERMOSTAT_VALVE, user_input, self.async_step_tpi
"type", STEP_THERMOSTAT_VALVE, user_input, self.async_step_menu
)
else:
return await self.generic_step(
"type",
STEP_THERMOSTAT_CLIMATE,
user_input,
self.async_step_presets,
self.async_step_menu,
)
async def async_step_features(self, user_input: dict | None = None) -> FlowResult:
"""Handle the Type flow steps"""
_LOGGER.debug("Into ConfigFlow.async_step_features user_input=%s", user_input)
return await self.generic_step(
"features",
STEP_FEATURES_DATA_SCHEMA,
user_input,
self.async_step_menu,
)
async def async_step_tpi(self, user_input: dict | None = None) -> FlowResult:
"""Handle the TPI flow steps"""
_LOGGER.debug("Into ConfigFlow.async_step_tpi user_input=%s", user_input)
schema = STEP_TPI_DATA_SCHEMA
next_step = (
self.async_step_spec_tpi
if user_input and user_input.get(CONF_USE_TPI_CENTRAL_CONFIG) is False
else self.async_step_presets
)
next_step = self.async_step_menu
if self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_CENTRAL_CONFIG:
schema = STEP_CENTRAL_TPI_DATA_SCHEMA
next_step = self.async_step_presets
elif self._infos.get(COMES_FROM) == "async_step_spec_tpi":
schema = STEP_CENTRAL_TPI_DATA_SCHEMA
else:
schema = STEP_TPI_DATA_SCHEMA
if (
user_input
and user_input.get(CONF_USE_TPI_CENTRAL_CONFIG, False) is False
):
if user_input and self._infos.get(COMES_FROM) == "async_step_spec_tpi":
schema = STEP_CENTRAL_TPI_DATA_SCHEMA
del self._infos[COMES_FROM]
else:
next_step = self.async_step_spec_tpi
return await self.generic_step("tpi", schema, user_input, next_step)
@@ -364,7 +481,7 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
schema = STEP_CENTRAL_TPI_DATA_SCHEMA
self._infos[COMES_FROM] = "async_step_spec_tpi"
next_step = self.async_step_presets
next_step = self.async_step_menu
return await self.generic_step("tpi", schema, user_input, next_step)
@@ -372,82 +489,41 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
"""Handle the presets flow steps"""
_LOGGER.debug("Into ConfigFlow.async_step_presets user_input=%s", user_input)
if self._infos.get(CONF_AC_MODE) is True:
schema_ac_or_not = STEP_CENTRAL_PRESETS_WITH_AC_DATA_SCHEMA
else:
schema_ac_or_not = STEP_CENTRAL_PRESETS_DATA_SCHEMA
next_step = self.async_step_advanced
next_step = self.async_step_menu # advanced
schema = STEP_PRESETS_DATA_SCHEMA
if self._infos[CONF_USE_WINDOW_FEATURE]:
next_step = self.async_step_window
elif self._infos[CONF_USE_MOTION_FEATURE]:
next_step = self.async_step_motion
elif self._infos[CONF_USE_POWER_FEATURE]:
next_step = self.async_step_power
elif self._infos[CONF_USE_PRESENCE_FEATURE]:
next_step = self.async_step_presence
# In Central config -> display the presets_with_ac and goto windows
# In Central config -> display the next step immedialty
if self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_CENTRAL_CONFIG:
schema = STEP_CENTRAL_PRESETS_WITH_AC_DATA_SCHEMA
next_step = self.async_step_window
# If comes from async_step_spec_presets
elif self._infos.get(COMES_FROM) == "async_step_spec_presets":
schema = schema_ac_or_not
elif user_input and user_input.get(CONF_USE_PRESETS_CENTRAL_CONFIG) is False:
next_step = self.async_step_spec_presets
schema = STEP_PRESETS_DATA_SCHEMA
# Call directly the next step, we have nothing to display here
return await self.async_step_window() # = self.async_step_window
return await self.generic_step("presets", schema, user_input, next_step)
async def async_step_spec_presets(
self, user_input: dict | None = None
) -> FlowResult:
"""Handle the specific presets flow steps"""
_LOGGER.debug(
"Into ConfigFlow.async_step_spec_presets user_input=%s", user_input
)
if self._infos.get(CONF_AC_MODE) is True:
schema = STEP_CENTRAL_PRESETS_WITH_AC_DATA_SCHEMA
else:
schema = STEP_CENTRAL_PRESETS_DATA_SCHEMA
self._infos[COMES_FROM] = "async_step_spec_presets"
next_step = self.async_step_window
# This will return to async_step_main (to keep the "main" step)
return await self.generic_step("presets", schema, user_input, next_step)
async def async_step_window(self, user_input: dict | None = None) -> FlowResult:
"""Handle the window sensor flow steps"""
_LOGGER.debug("Into ConfigFlow.async_step_window user_input=%s", user_input)
schema = STEP_WINDOW_DATA_SCHEMA
next_step = self.async_step_advanced
if self._infos[CONF_USE_MOTION_FEATURE]:
next_step = self.async_step_motion
elif self._infos[CONF_USE_POWER_FEATURE]:
next_step = self.async_step_power
elif self._infos[CONF_USE_PRESENCE_FEATURE]:
next_step = self.async_step_presence
# In Central config -> display the presets_with_ac and goto windows
next_step = self.async_step_menu
if self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_CENTRAL_CONFIG:
schema = STEP_CENTRAL_WINDOW_DATA_SCHEMA
next_step = self.async_step_motion
# If comes from async_step_spec_window
elif self._infos.get(COMES_FROM) == "async_step_spec_window":
# If we have a window sensor don't display the auto window parameters
if self._infos.get(CONF_WINDOW_SENSOR) is not None:
schema = STEP_CENTRAL_WINDOW_WO_AUTO_DATA_SCHEMA
else:
schema = STEP_CENTRAL_WINDOW_DATA_SCHEMA
elif user_input and user_input.get(CONF_USE_WINDOW_CENTRAL_CONFIG) is False:
next_step = self.async_step_spec_window
else:
schema = STEP_WINDOW_DATA_SCHEMA
if (
user_input
and user_input.get(CONF_USE_WINDOW_CENTRAL_CONFIG, False) is False
):
if (
user_input
and self._infos.get(COMES_FROM) == "async_step_spec_window"
):
if self._infos.get(CONF_WINDOW_SENSOR) is not None:
schema = STEP_CENTRAL_WINDOW_WO_AUTO_DATA_SCHEMA
else:
schema = STEP_CENTRAL_WINDOW_DATA_SCHEMA
del self._infos[COMES_FROM]
else:
next_step = self.async_step_spec_window
return await self.generic_step("window", schema, user_input, next_step)
@@ -474,23 +550,24 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
"""Handle the window and motion sensor flow steps"""
_LOGGER.debug("Into ConfigFlow.async_step_motion user_input=%s", user_input)
schema = STEP_MOTION_DATA_SCHEMA
next_step = self.async_step_advanced
if self._infos[CONF_USE_POWER_FEATURE]:
next_step = self.async_step_power
elif self._infos[CONF_USE_PRESENCE_FEATURE]:
next_step = self.async_step_presence
# In Central config -> display the presets_with_ac and goto windows
next_step = self.async_step_menu
if self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_CENTRAL_CONFIG:
schema = STEP_CENTRAL_MOTION_DATA_SCHEMA
next_step = self.async_step_power
# If comes from async_step_spec_motion
elif self._infos.get(COMES_FROM) == "async_step_spec_motion":
schema = STEP_CENTRAL_MOTION_DATA_SCHEMA
elif user_input and user_input.get(CONF_USE_MOTION_CENTRAL_CONFIG) is False:
next_step = self.async_step_spec_motion
else:
schema = STEP_MOTION_DATA_SCHEMA
if (
user_input
and user_input.get(CONF_USE_MOTION_CENTRAL_CONFIG, False) is False
):
if (
user_input
and self._infos.get(COMES_FROM) == "async_step_spec_motion"
):
schema = STEP_CENTRAL_MOTION_DATA_SCHEMA
del self._infos[COMES_FROM]
else:
next_step = self.async_step_spec_motion
return await self.generic_step("motion", schema, user_input, next_step)
@@ -506,7 +583,7 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
self._infos[COMES_FROM] = "async_step_spec_motion"
next_step = self.async_step_power
next_step = self.async_step_menu
# This will return to async_step_main (to keep the "main" step)
return await self.generic_step("motion", schema, user_input, next_step)
@@ -515,21 +592,24 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
"""Handle the power management flow steps"""
_LOGGER.debug("Into ConfigFlow.async_step_power user_input=%s", user_input)
schema = STEP_POWER_DATA_SCHEMA
next_step = self.async_step_advanced
if self._infos[CONF_USE_PRESENCE_FEATURE]:
next_step = self.async_step_presence
# In Central config -> display the presets_with_ac and goto windows
next_step = self.async_step_menu
if self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_CENTRAL_CONFIG:
schema = STEP_CENTRAL_POWER_DATA_SCHEMA
next_step = self.async_step_presence
# If comes from async_step_spec_motion
elif self._infos.get(COMES_FROM) == "async_step_spec_power":
schema = STEP_CENTRAL_POWER_DATA_SCHEMA
elif user_input and user_input.get(CONF_USE_POWER_CENTRAL_CONFIG) is False:
next_step = self.async_step_spec_power
else:
schema = STEP_POWER_DATA_SCHEMA
if (
user_input
and user_input.get(CONF_USE_POWER_CENTRAL_CONFIG, False) is False
):
if (
user_input
and self._infos.get(COMES_FROM) == "async_step_spec_power"
):
schema = STEP_CENTRAL_POWER_DATA_SCHEMA
del self._infos[COMES_FROM]
else:
next_step = self.async_step_spec_power
return await self.generic_step("power", schema, user_input, next_step)
@@ -541,7 +621,7 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
self._infos[COMES_FROM] = "async_step_spec_power"
next_step = self.async_step_presence
next_step = self.async_step_menu
# This will return to async_step_power (to keep the "power" step)
return await self.generic_step("power", schema, user_input, next_step)
@@ -550,25 +630,31 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
"""Handle the presence management flow steps"""
_LOGGER.debug("Into ConfigFlow.async_step_presence user_input=%s", user_input)
schema = STEP_PRESENCE_DATA_SCHEMA
next_step = self.async_step_advanced
# In Central config -> display the presets_with_ac and goto windows
next_step = self.async_step_menu
if self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_CENTRAL_CONFIG:
schema = STEP_CENTRAL_PRESENCE_DATA_SCHEMA
next_step = self.async_step_advanced
# If comes from async_step_spec_presence
elif self._infos.get(COMES_FROM) == "async_step_spec_presence":
schema = STEP_CENTRAL_PRESENCE_DATA_SCHEMA
elif user_input and user_input.get(CONF_USE_PRESENCE_CENTRAL_CONFIG) is False:
next_step = self.async_step_spec_presence
else:
schema = STEP_PRESENCE_DATA_SCHEMA
if (
user_input
and user_input.get(CONF_USE_PRESENCE_CENTRAL_CONFIG, False) is False
):
if (
user_input
and self._infos.get(COMES_FROM) == "async_step_spec_presence"
):
schema = STEP_CENTRAL_PRESENCE_DATA_SCHEMA
del self._infos[COMES_FROM]
else:
next_step = self.async_step_spec_presence
return await self.generic_step("presence", schema, user_input, next_step)
async def async_step_spec_presence(
self, user_input: dict | None = None
) -> FlowResult:
"""Handle the specific preseence flow steps"""
"""Handle the specific power flow steps"""
_LOGGER.debug(
"Into ConfigFlow.async_step_spec_presence user_input=%s", user_input
)
@@ -577,26 +663,33 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
self._infos[COMES_FROM] = "async_step_spec_presence"
next_step = self.async_step_advanced
next_step = self.async_step_menu
# This will return to async_step_presence (to keep the "presence" step)
# This will return to async_step_power (to keep the "power" step)
return await self.generic_step("presence", schema, user_input, next_step)
async def async_step_advanced(self, user_input: dict | None = None) -> FlowResult:
"""Handle the advanced parameter flow steps"""
_LOGGER.debug("Into ConfigFlow.async_step_advanced user_input=%s", user_input)
schema = STEP_ADVANCED_DATA_SCHEMA
next_step = self.async_finalize
# In Central config -> display the presets_with_ac and goto windows
next_step = self.async_step_menu
if self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_CENTRAL_CONFIG:
schema = STEP_CENTRAL_ADVANCED_DATA_SCHEMA
# If comes from async_step_spec_presence
elif self._infos.get(COMES_FROM) == "async_step_spec_advanced":
schema = STEP_CENTRAL_ADVANCED_DATA_SCHEMA
elif user_input and user_input.get(CONF_USE_ADVANCED_CENTRAL_CONFIG) is False:
next_step = self.async_step_spec_advanced
else:
schema = STEP_ADVANCED_DATA_SCHEMA
if (
user_input
and user_input.get(CONF_USE_ADVANCED_CENTRAL_CONFIG, False) is False
):
if (
user_input
and self._infos.get(COMES_FROM) == "async_step_spec_advanced"
):
schema = STEP_CENTRAL_ADVANCED_DATA_SCHEMA
del self._infos[COMES_FROM]
else:
next_step = self.async_step_spec_advanced
return await self.generic_step("advanced", schema, user_input, next_step)
@@ -617,22 +710,12 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
# This will return to async_step_presence (to keep the "presence" step)
return await self.generic_step("advanced", schema, user_input, next_step)
async def async_finalize(self):
async def async_step_finalize(self, _):
"""Should be implemented by Leaf classes"""
raise HomeAssistantError(
"async_finalize not implemented on VersatileThermostat sub-class"
)
# Not used but can be useful in the future
# def find_all_climates(self) -> list(str):
# """Find all climate known by HA"""
# component: EntityComponent[ClimateEntity] = self.hass.data[CLIMATE_DOMAIN]
# ret: list(str) = list()
# for entity in component.entities:
# ret.append(entity.entity_id)
# _LOGGER.debug("Found all climate entities: %s", ret)
# return ret
class VersatileThermostatConfigFlow(
VersatileThermostatBaseConfigFlow, HAConfigFlow, domain=DOMAIN
@@ -650,7 +733,7 @@ class VersatileThermostatConfigFlow(
"""Get options flow for this handler"""
return VersatileThermostatOptionsFlowHandler(config_entry)
async def async_finalize(self):
async def async_step_finalize(self, _):
"""Finalization of the ConfigEntry creation"""
_LOGGER.debug("ConfigFlow.async_finalize")
# Removes temporary value
@@ -685,155 +768,9 @@ class VersatileThermostatOptionsFlowHandler(
CONF_NAME: self._infos[CONF_NAME],
}
return await self.async_step_main(user_input)
return await self.async_step_menu(user_input)
# async def async_step_main(self, user_input: dict | None = None) -> FlowResult:
# """Handle the flow steps"""
# _LOGGER.debug(
# "Into OptionsFlowHandler.async_step_user user_input=%s", user_input
# )
# return await self.generic_step(
# "user", STEP_USER_DATA_SCHEMA, user_input, self.async_step_type
# )
# async def async_step_type(self, user_input: dict | None = None) -> FlowResult:
# """Handle the flow steps"""
# _LOGGER.debug(
# "Into OptionsFlowHandler.async_step_user user_input=%s", user_input
# )
# if self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_SWITCH:
# return await self.generic_step(
# "type", STEP_THERMOSTAT_SWITCH, user_input, self.async_step_tpi
# )
# elif self._infos[CONF_THERMOSTAT_TYPE] == CONF_THERMOSTAT_VALVE:
# return await self.generic_step(
# "type", STEP_THERMOSTAT_VALVE, user_input, self.async_step_tpi
# )
# else:
# return await self.generic_step(
# "type",
# STEP_THERMOSTAT_CLIMATE,
# user_input,
# self.async_step_presets,
# )
# async def async_step_tpi(self, user_input: dict | None = None) -> FlowResult:
# """Handle the tpi flow steps"""
# _LOGGER.debug(
# "Into OptionsFlowHandler.async_step_tpi user_input=%s", user_input
# )
# return await self.generic_step(
# "tpi", STEP_TPI_DATA_SCHEMA, user_input, self.async_step_presets
# )
# async def async_step_presets(self, user_input: dict | None = None) -> FlowResult:
# """Handle the presets flow steps"""
# _LOGGER.debug(
# "Into OptionsFlowHandler.async_step_presets user_input=%s", user_input
# )
# next_step = self.async_step_advanced
# if self._infos[CONF_USE_WINDOW_FEATURE]:
# next_step = self.async_step_window
# elif self._infos[CONF_USE_MOTION_FEATURE]:
# next_step = self.async_step_motion
# elif self._infos[CONF_USE_POWER_FEATURE]:
# next_step = self.async_step_power
# elif self._infos[CONF_USE_PRESENCE_FEATURE]:
# next_step = self.async_step_presence
# if self._infos.get(CONF_AC_MODE) is True:
# schema = STEP_PRESETS_WITH_AC_DATA_SCHEMA
# else:
# schema = STEP_PRESETS_DATA_SCHEMA
# return await self.generic_step("presets", schema, user_input, next_step)
# async def async_step_window(self, user_input: dict | None = None) -> FlowResult:
# """Handle the window sensor flow steps"""
# _LOGGER.debug(
# "Into OptionsFlowHandler.async_step_window user_input=%s", user_input
# )
# next_step = self.async_step_advanced
# if self._infos[CONF_USE_MOTION_FEATURE]:
# next_step = self.async_step_motion
# elif self._infos[CONF_USE_POWER_FEATURE]:
# next_step = self.async_step_power
# elif self._infos[CONF_USE_PRESENCE_FEATURE]:
# next_step = self.async_step_presence
# return await self.generic_step(
# "window", STEP_WINDOW_DATA_SCHEMA, user_input, next_step
# )
# async def async_step_motion(self, user_input: dict | None = None) -> FlowResult:
# """Handle the window and motion sensor flow steps"""
# _LOGGER.debug(
# "Into OptionsFlowHandler.async_step_motion user_input=%s", user_input
# )
# next_step = self.async_step_advanced
# if self._infos[CONF_USE_POWER_FEATURE]:
# next_step = self.async_step_power
# elif self._infos[CONF_USE_PRESENCE_FEATURE]:
# next_step = self.async_step_presence
# return await self.generic_step(
# "motion", STEP_MOTION_DATA_SCHEMA, user_input, next_step
# )
# async def async_step_power(self, user_input: dict | None = None) -> FlowResult:
# """Handle the power management flow steps"""
# _LOGGER.debug(
# "Into OptionsFlowHandler.async_step_power user_input=%s", user_input
# )
# next_step = self.async_step_advanced
# if self._infos[CONF_USE_PRESENCE_FEATURE]:
# next_step = self.async_step_presence
# return await self.generic_step(
# "power",
# STEP_POWER_DATA_SCHEMA,
# user_input,
# next_step,
# )
# async def async_step_presence(self, user_input: dict | None = None) -> FlowResult:
# """Handle the presence management flow steps"""
# _LOGGER.debug(
# "Into OptionsFlowHandler.async_step_presence user_input=%s", user_input
# )
# if self._infos.get(CONF_AC_MODE) is True:
# schema = STEP_PRESENCE_WITH_AC_DATA_SCHEMA
# else:
# schema = STEP_PRESENCE_DATA_SCHEMA
# return await self.generic_step(
# "presence",
# schema,
# user_input,
# self.async_step_advanced,
# )
# async def async_step_advanced(self, user_input: dict | None = None) -> FlowResult:
# """Handle the advanced flow steps"""
# _LOGGER.debug(
# "Into OptionsFlowHandler.async_step_advanced user_input=%s", user_input
# )
# return await self.generic_step(
# "advanced",
# STEP_ADVANCED_DATA_SCHEMA,
# user_input,
# self.async_end,
# )
async def async_finalize(self):
async def async_step_finalize(self, _):
"""Finalization of the ConfigEntry creation"""
if not self._infos[CONF_USE_WINDOW_FEATURE]:
self._infos[CONF_USE_WINDOW_CENTRAL_CONFIG] = False

View File

@@ -44,13 +44,18 @@ STEP_MAIN_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
),
vol.Required(CONF_CYCLE_MIN, default=5): cv.positive_int,
vol.Optional(CONF_DEVICE_POWER, default="1"): vol.Coerce(float),
vol.Optional(CONF_USE_CENTRAL_MODE, default=True): cv.boolean,
vol.Required(CONF_USE_MAIN_CENTRAL_CONFIG, default=True): cv.boolean,
vol.Optional(CONF_USE_CENTRAL_MODE, default=True): cv.boolean,
vol.Required(CONF_USED_BY_CENTRAL_BOILER, default=False): cv.boolean,
}
)
STEP_FEATURES_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
{
vol.Optional(CONF_USE_WINDOW_FEATURE, default=False): cv.boolean,
vol.Optional(CONF_USE_MOTION_FEATURE, default=False): cv.boolean,
vol.Optional(CONF_USE_POWER_FEATURE, default=False): cv.boolean,
vol.Optional(CONF_USE_PRESENCE_FEATURE, default=False): cv.boolean,
vol.Required(CONF_USED_BY_CENTRAL_BOILER, default=False): cv.boolean,
}
)
@@ -192,18 +197,6 @@ STEP_PRESETS_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
}
)
STEP_CENTRAL_PRESETS_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
{vol.Optional(v, default=0): vol.Coerce(float) for (k, v) in CONF_PRESETS.items()}
)
STEP_CENTRAL_PRESETS_WITH_AC_DATA_SCHEMA = (
vol.Schema( # pylint: disable=invalid-name # pylint: disable=invalid-name
{
vol.Optional(v, default=0): vol.Coerce(float)
for (k, v) in CONF_PRESETS_WITH_AC.items()
}
)
)
STEP_WINDOW_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
{
@@ -251,7 +244,7 @@ STEP_CENTRAL_WINDOW_WO_AUTO_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid
STEP_MOTION_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
{
vol.Optional(CONF_MOTION_SENSOR): selector.EntitySelector(
vol.Required(CONF_MOTION_SENSOR): selector.EntitySelector(
selector.EntitySelectorConfig(
domain=[BINARY_SENSOR_DOMAIN, INPUT_BOOLEAN_DOMAIN]
),
@@ -283,10 +276,10 @@ STEP_CENTRAL_MOTION_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
STEP_CENTRAL_POWER_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
{
vol.Optional(CONF_POWER_SENSOR): selector.EntitySelector(
vol.Required(CONF_POWER_SENSOR): selector.EntitySelector(
selector.EntitySelectorConfig(domain=[SENSOR_DOMAIN, INPUT_NUMBER_DOMAIN]),
),
vol.Optional(CONF_MAX_POWER_SENSOR): selector.EntitySelector(
vol.Required(CONF_MAX_POWER_SENSOR): selector.EntitySelector(
selector.EntitySelectorConfig(domain=[SENSOR_DOMAIN, INPUT_NUMBER_DOMAIN]),
),
vol.Optional(CONF_PRESET_POWER, default="13"): vol.Coerce(float),
@@ -301,19 +294,7 @@ STEP_POWER_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
STEP_CENTRAL_PRESENCE_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
{
vol.Optional(v, default=17): vol.Coerce(float)
for (k, v) in CONF_PRESETS_AWAY.items()
}
)
STEP_CENTRAL_PRESENCE_WITH_AC_DATA_SCHEMA = { # pylint: disable=invalid-name
vol.Optional(v, default=17): vol.Coerce(float)
for (k, v) in CONF_PRESETS_AWAY_WITH_AC.items()
}
STEP_PRESENCE_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
{
vol.Optional(CONF_PRESENCE_SENSOR): selector.EntitySelector(
vol.Required(CONF_PRESENCE_SENSOR): selector.EntitySelector(
selector.EntitySelectorConfig(
domain=[
PERSON_DOMAIN,
@@ -321,7 +302,12 @@ STEP_PRESENCE_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
INPUT_BOOLEAN_DOMAIN,
]
),
),
)
},
)
STEP_PRESENCE_DATA_SCHEMA = vol.Schema( # pylint: disable=invalid-name
{
vol.Required(CONF_USE_PRESENCE_CENTRAL_CONFIG, default=True): cv.boolean,
}
)

View File

@@ -12,13 +12,31 @@
"thermostat_type": "Only one central configuration type is possible"
}
},
"menu": {
"title": "Menu",
"description": "Configure your thermostat. You will be able to finalize the configuration when all needed parameters are valued.",
"menu_options": {
"main": "Main attributes",
"central_boiler": "Central boiler",
"type": "Underlyings",
"tpi": "TPI parameters",
"features": "Features",
"presets": "Presets",
"window": "Window detection",
"motion": "Motion detection",
"power": "Power management",
"presence": "Presence detection",
"advanced": "Advanced parameters",
"finalize": "All done"
}
},
"main": {
"title": "Add new Versatile Thermostat",
"description": "Main mandatory attributes",
"data": {
"name": "Name",
"thermostat_type": "Thermostat type",
"temperature_sensor_entity_id": "Temperature sensor entity id",
"temperature_sensor_entity_id": "Room temperature sensor entity id",
"external_temperature_sensor_entity_id": "Outdoor temperature sensor entity id",
"cycle_min": "Cycle duration (minutes)",
"temp_min": "Minimal temperature allowed",
@@ -26,11 +44,7 @@
"step_temperature": "Temperature step",
"device_power": "Device power",
"use_central_mode": "Enable the control by central entity (need central config). Check to enable the control of the VTherm with the select central_mode entities.",
"use_window_feature": "Use window detection",
"use_motion_feature": "Use motion detection",
"use_power_feature": "Use power management",
"use_presence_feature": "Use presence detection",
"use_main_central_config": "Use central main configuration. Check to use the central main configuration. Uncheck to use a specific main configuration for this VTherm",
"use_main_central_config": "Use additional central main configuration. Check to use the central main configuration (outdoor temperature, min, max, step, ...).",
"add_central_boiler_control": "Add a central boiler. Check to add a control to your central boiler. You will have to configure the VTherm which will have a control of the central boiler after seecting this checkbox to take effect. If one VTherm need heating, the boiler will be turned on. If no VTherm needs heating, the boiler will be turned off. Commands for turning on/off the central boiler are given in the next configuration page",
"used_by_controls_central_boiler": "Used by central boiler. Check if this VTherm should have control on the central boiler"
},
@@ -38,6 +52,16 @@
"external_temperature_sensor_entity_id": "Outdoor temperature sensor entity id. Not used if central configuration is selected"
}
},
"features": {
"title": "Features",
"description": "Thermostat features",
"data": {
"use_window_feature": "Use window detection",
"use_motion_feature": "Use motion detection",
"use_power_feature": "Use power management",
"use_presence_feature": "Use presence detection"
}
},
"type": {
"title": "Linked entities",
"description": "Linked entities attributes",
@@ -104,26 +128,9 @@
},
"presets": {
"title": "Presets",
"description": "For each preset set the target temperature (0 to ignore preset)",
"description": "Check if the thermostat will use central presets. Uncheck and the thermostat will have its own preset entities",
"data": {
"eco_temp": "Eco preset",
"comfort_temp": "Comfort preset",
"boost_temp": "Boost preset",
"frost_temp": "Frost protection preset",
"eco_ac_temp": "Eco preset for AC mode",
"comfort_ac_temp": "Comfort preset for AC mode",
"boost_ac_temp": "Boost preset for AC mode",
"use_presets_central_config": "Use central presets configuration"
},
"data_description": {
"eco_temp": "Temperature in Eco preset",
"comfort_temp": "Temperature in Comfort preset",
"boost_temp": "Temperature in Boost preset",
"frost_temp": "Temperature in Frost protection preset",
"eco_ac_temp": "Temperature in Eco preset for AC mode",
"comfort_ac_temp": "Temperature in Comfort preset for AC mode",
"boost_ac_temp": "Temperature in Boost preset for AC mode",
"use_presets_central_config": "Check to use the central presets configuration. Uncheck to use a specific presets configuration for this VTherm"
}
},
"window": {
@@ -189,25 +196,10 @@
"description": "Presence management attributes.\nGives the a presence sensor of your home (true is someone is present) and give the corresponding temperature preset setting.",
"data": {
"presence_sensor_entity_id": "Presence sensor",
"eco_away_temp": "Eco preset",
"comfort_away_temp": "Comfort preset",
"boost_away_temp": "Boost preset",
"frost_away_temp": "Frost protection preset",
"eco_ac_away_temp": "Eco preset in AC mode",
"comfort_ac_away_temp": "Comfort preset in AC mode",
"boost_ac_away_temp": "Boost pres et in AC mode",
"use_presence_central_config": "Use central presence configuration"
"use_presence_central_config": "Use central presence temperature configuration. Uncheck to use specific temperature entities"
},
"data_description": {
"presence_sensor_entity_id": "Presence sensor entity id",
"eco_away_temp": "Temperature in Eco preset when no presence",
"comfort_away_temp": "Temperature in Comfort preset when no presence",
"boost_away_temp": "Temperature in Boost preset when no presence",
"frost_away_temp": "Temperature in Frost protection preset when no presence",
"eco_ac_away_temp": "Temperature in Eco preset when no presence in AC mode",
"comfort_ac_away_temp": "Temperature in Comfort preset when no presence in AC mode",
"boost_ac_away_temp": "Temperature in Boost preset when no presence in AC mode",
"use_presence_central_config": "Check to use the central presence configuration. Uncheck to use a specific presence configuration for this VTherm"
"presence_sensor_entity_id": "Presence sensor entity id"
}
},
"advanced": {
@@ -251,6 +243,24 @@
"thermostat_type": "Only one central configuration type is possible"
}
},
"menu": {
"title": "Menu",
"description": "Configure your thermostat. You will be able to finalize the configuration when all needed parameters are valued.",
"menu_options": {
"main": "Main attributes",
"central_boiler": "Central boiler",
"type": "Underlyings",
"tpi": "TPI parameters",
"features": "Features",
"presets": "Presets",
"window": "Window detection",
"motion": "Motion detection",
"power": "Power management",
"presence": "Presence detection",
"advanced": "Advanced parameters",
"finalize": "All done"
}
},
"main": {
"title": "Main - {name}",
"description": "Main mandatory attributes",
@@ -265,11 +275,7 @@
"step_temperature": "Temperature step",
"device_power": "Device power",
"use_central_mode": "Enable the control by central entity (need central config). Check to enable the control of the VTherm with the select central_mode entities.",
"use_window_feature": "Use window detection",
"use_motion_feature": "Use motion detection",
"use_power_feature": "Use power management",
"use_presence_feature": "Use presence detection",
"use_main_central_config": "Use central main configuration. Check to use the central main configuration. Uncheck to use a specific main configuration for this VTherm",
"use_main_central_config": "Use additional central main configuration. Check to use the central main configuration (outdoor temperature, min, max, step, ...).",
"add_central_boiler_control": "Add a central boiler. Check to add a control to your central boiler. You will have to configure the VTherm which will have a control of the central boiler after seecting this checkbox to take effect. If one VTherm need heating, the boiler will be turned on. If no VTherm needs heating, the boiler will be turned off. Commands for turning on/off the central boiler are given in the next configuration page",
"used_by_controls_central_boiler": "Used by central boiler. Check if this VTherm should have control on the central boiler"
},
@@ -277,6 +283,16 @@
"external_temperature_sensor_entity_id": "Outdoor temperature sensor entity id. Not used if central configuration is selected"
}
},
"features": {
"title": "Features - {name}",
"description": "Thermostat features",
"data": {
"use_window_feature": "Use window detection",
"use_motion_feature": "Use motion detection",
"use_power_feature": "Use power management",
"use_presence_feature": "Use presence detection"
}
},
"type": {
"title": "Entities - {name}",
"description": "Linked entities attributes",
@@ -343,26 +359,9 @@
},
"presets": {
"title": "Presets - {name}",
"description": "For each preset set the target temperature (0 to ignore preset)",
"description": "Check if the thermostat will use central presets. Uncheck and the thermostat will have its own preset entities",
"data": {
"eco_temp": "Eco preset",
"comfort_temp": "Comfort preset",
"boost_temp": "Boost preset",
"frost_temp": "Frost protection preset",
"eco_ac_temp": "Eco preset for AC mode",
"comfort_ac_temp": "Comfort preset for AC mode",
"boost_ac_temp": "Boost preset for AC mode",
"use_presets_central_config": "Use central presets configuration"
},
"data_description": {
"eco_temp": "Temperature in Eco preset",
"comfort_temp": "Temperature in Comfort preset",
"boost_temp": "Temperature in Boost preset",
"frost_temp": "Temperature in Frost protection preset",
"eco_ac_temp": "Temperature in Eco preset for AC mode",
"comfort_ac_temp": "Temperature in Comfort preset for AC mode",
"boost_ac_temp": "Temperature in Boost preset for AC mode",
"use_presets_central_config": "Check to use the central presets configuration. Uncheck to use a specific presets configuration for this VTherm"
}
},
"window": {
@@ -428,25 +427,10 @@
"description": "Presence management attributes.\nGives the a presence sensor of your home (true is someone is present) and give the corresponding temperature preset setting.",
"data": {
"presence_sensor_entity_id": "Presence sensor",
"eco_away_temp": "Eco away preset",
"comfort_away_temp": "Comfort away preset",
"boost_away_temp": "Boost away preset",
"frost_away_temp": "Frost protection preset",
"eco_ac_away_temp": "Eco away preset in AC mode",
"comfort_ac_away_temp": "Comfort away preset in AC mode",
"boost_ac_away_temp": "Boost away preset in AC mode",
"use_presence_central_config": "Use central presence configuration"
"use_presence_central_config": "Use central presence temperature configuration. Uncheck to use specific temperature entities"
},
"data_description": {
"presence_sensor_entity_id": "Presence sensor entity id",
"eco_away_temp": "Temperature in Eco preset when no presence",
"comfort_away_temp": "Temperature in Comfort preset when no presence",
"boost_away_temp": "Temperature in Boost preset when no presence",
"frost_away_temp": "Temperature in Frost protection preset when no presence",
"eco_ac_away_temp": "Temperature in Eco preset when no presence in AC mode",
"comfort_ac_away_temp": "Temperature in Comfort preset when no presence in AC mode",
"boost_ac_away_temp": "Temperature in Boost preset when no presence in AC mode",
"use_presence_central_config": "Check to use the central presence configuration. Uncheck to use a specific presence configuration for this VTherm"
"presence_sensor_entity_id": "Presence sensor entity id"
}
},
"advanced": {
@@ -539,9 +523,6 @@
}
},
"number": {
"temperature": {
"name": "{preset}{ac}-{away} [%key:component::sensor::entity_component::temperature::name%]"
},
"frost_temp": {
"name": "Frost"
},

View File

@@ -12,13 +12,31 @@
"thermostat_type": "Only one central configuration type is possible"
}
},
"menu": {
"title": "Menu",
"description": "Configure your thermostat. You will be able to finalize the configuration when all needed parameters are valued.",
"menu_options": {
"main": "Main attributes",
"central_boiler": "Central boiler",
"type": "Underlyings",
"tpi": "TPI parameters",
"features": "Features",
"presets": "Presets",
"window": "Window detection",
"motion": "Motion detection",
"power": "Power management",
"presence": "Presence detection",
"advanced": "Advanced parameters",
"finalize": "All done"
}
},
"main": {
"title": "Add new Versatile Thermostat",
"description": "Main mandatory attributes",
"data": {
"name": "Name",
"thermostat_type": "Thermostat type",
"temperature_sensor_entity_id": "Temperature sensor entity id",
"temperature_sensor_entity_id": "Room temperature sensor entity id",
"external_temperature_sensor_entity_id": "Outdoor temperature sensor entity id",
"cycle_min": "Cycle duration (minutes)",
"temp_min": "Minimal temperature allowed",
@@ -26,11 +44,7 @@
"step_temperature": "Temperature step",
"device_power": "Device power",
"use_central_mode": "Enable the control by central entity (need central config). Check to enable the control of the VTherm with the select central_mode entities.",
"use_window_feature": "Use window detection",
"use_motion_feature": "Use motion detection",
"use_power_feature": "Use power management",
"use_presence_feature": "Use presence detection",
"use_main_central_config": "Use central main configuration. Check to use the central main configuration. Uncheck to use a specific main configuration for this VTherm",
"use_main_central_config": "Use additional central main configuration. Check to use the central main configuration (outdoor temperature, min, max, step, ...).",
"add_central_boiler_control": "Add a central boiler. Check to add a control to your central boiler. You will have to configure the VTherm which will have a control of the central boiler after seecting this checkbox to take effect. If one VTherm need heating, the boiler will be turned on. If no VTherm needs heating, the boiler will be turned off. Commands for turning on/off the central boiler are given in the next configuration page",
"used_by_controls_central_boiler": "Used by central boiler. Check if this VTherm should have control on the central boiler"
},
@@ -38,6 +52,16 @@
"external_temperature_sensor_entity_id": "Outdoor temperature sensor entity id. Not used if central configuration is selected"
}
},
"features": {
"title": "Features",
"description": "Thermostat features",
"data": {
"use_window_feature": "Use window detection",
"use_motion_feature": "Use motion detection",
"use_power_feature": "Use power management",
"use_presence_feature": "Use presence detection"
}
},
"type": {
"title": "Linked entities",
"description": "Linked entities attributes",
@@ -104,26 +128,9 @@
},
"presets": {
"title": "Presets",
"description": "For each preset set the target temperature (0 to ignore preset)",
"description": "Check if the thermostat will use central presets. Uncheck and the thermostat will have its own preset entities",
"data": {
"eco_temp": "Eco preset",
"comfort_temp": "Comfort preset",
"boost_temp": "Boost preset",
"frost_temp": "Frost protection preset",
"eco_ac_temp": "Eco preset for AC mode",
"comfort_ac_temp": "Comfort preset for AC mode",
"boost_ac_temp": "Boost preset for AC mode",
"use_presets_central_config": "Use central presets configuration"
},
"data_description": {
"eco_temp": "Temperature in Eco preset",
"comfort_temp": "Temperature in Comfort preset",
"boost_temp": "Temperature in Boost preset",
"frost_temp": "Temperature in Frost protection preset",
"eco_ac_temp": "Temperature in Eco preset for AC mode",
"comfort_ac_temp": "Temperature in Comfort preset for AC mode",
"boost_ac_temp": "Temperature in Boost preset for AC mode",
"use_presets_central_config": "Check to use the central presets configuration. Uncheck to use a specific presets configuration for this VTherm"
}
},
"window": {
@@ -189,25 +196,10 @@
"description": "Presence management attributes.\nGives the a presence sensor of your home (true is someone is present) and give the corresponding temperature preset setting.",
"data": {
"presence_sensor_entity_id": "Presence sensor",
"eco_away_temp": "Eco preset",
"comfort_away_temp": "Comfort preset",
"boost_away_temp": "Boost preset",
"frost_away_temp": "Frost protection preset",
"eco_ac_away_temp": "Eco preset in AC mode",
"comfort_ac_away_temp": "Comfort preset in AC mode",
"boost_ac_away_temp": "Boost pres et in AC mode",
"use_presence_central_config": "Use central presence configuration"
"use_presence_central_config": "Use central presence temperature configuration. Uncheck to use specific temperature entities"
},
"data_description": {
"presence_sensor_entity_id": "Presence sensor entity id",
"eco_away_temp": "Temperature in Eco preset when no presence",
"comfort_away_temp": "Temperature in Comfort preset when no presence",
"boost_away_temp": "Temperature in Boost preset when no presence",
"frost_away_temp": "Temperature in Frost protection preset when no presence",
"eco_ac_away_temp": "Temperature in Eco preset when no presence in AC mode",
"comfort_ac_away_temp": "Temperature in Comfort preset when no presence in AC mode",
"boost_ac_away_temp": "Temperature in Boost preset when no presence in AC mode",
"use_presence_central_config": "Check to use the central presence configuration. Uncheck to use a specific presence configuration for this VTherm"
"presence_sensor_entity_id": "Presence sensor entity id"
}
},
"advanced": {
@@ -251,6 +243,24 @@
"thermostat_type": "Only one central configuration type is possible"
}
},
"menu": {
"title": "Menu",
"description": "Configure your thermostat. You will be able to finalize the configuration when all needed parameters are valued.",
"menu_options": {
"main": "Main attributes",
"central_boiler": "Central boiler",
"type": "Underlyings",
"tpi": "TPI parameters",
"features": "Features",
"presets": "Presets",
"window": "Window detection",
"motion": "Motion detection",
"power": "Power management",
"presence": "Presence detection",
"advanced": "Advanced parameters",
"finalize": "All done"
}
},
"main": {
"title": "Main - {name}",
"description": "Main mandatory attributes",
@@ -265,11 +275,7 @@
"step_temperature": "Temperature step",
"device_power": "Device power",
"use_central_mode": "Enable the control by central entity (need central config). Check to enable the control of the VTherm with the select central_mode entities.",
"use_window_feature": "Use window detection",
"use_motion_feature": "Use motion detection",
"use_power_feature": "Use power management",
"use_presence_feature": "Use presence detection",
"use_main_central_config": "Use central main configuration. Check to use the central main configuration. Uncheck to use a specific main configuration for this VTherm",
"use_main_central_config": "Use additional central main configuration. Check to use the central main configuration (outdoor temperature, min, max, step, ...).",
"add_central_boiler_control": "Add a central boiler. Check to add a control to your central boiler. You will have to configure the VTherm which will have a control of the central boiler after seecting this checkbox to take effect. If one VTherm need heating, the boiler will be turned on. If no VTherm needs heating, the boiler will be turned off. Commands for turning on/off the central boiler are given in the next configuration page",
"used_by_controls_central_boiler": "Used by central boiler. Check if this VTherm should have control on the central boiler"
},
@@ -277,6 +283,16 @@
"external_temperature_sensor_entity_id": "Outdoor temperature sensor entity id. Not used if central configuration is selected"
}
},
"features": {
"title": "Features - {name}",
"description": "Thermostat features",
"data": {
"use_window_feature": "Use window detection",
"use_motion_feature": "Use motion detection",
"use_power_feature": "Use power management",
"use_presence_feature": "Use presence detection"
}
},
"type": {
"title": "Entities - {name}",
"description": "Linked entities attributes",
@@ -343,26 +359,9 @@
},
"presets": {
"title": "Presets - {name}",
"description": "For each preset set the target temperature (0 to ignore preset)",
"description": "Check if the thermostat will use central presets. Uncheck and the thermostat will have its own preset entities",
"data": {
"eco_temp": "Eco preset",
"comfort_temp": "Comfort preset",
"boost_temp": "Boost preset",
"frost_temp": "Frost protection preset",
"eco_ac_temp": "Eco preset for AC mode",
"comfort_ac_temp": "Comfort preset for AC mode",
"boost_ac_temp": "Boost preset for AC mode",
"use_presets_central_config": "Use central presets configuration"
},
"data_description": {
"eco_temp": "Temperature in Eco preset",
"comfort_temp": "Temperature in Comfort preset",
"boost_temp": "Temperature in Boost preset",
"frost_temp": "Temperature in Frost protection preset",
"eco_ac_temp": "Temperature in Eco preset for AC mode",
"comfort_ac_temp": "Temperature in Comfort preset for AC mode",
"boost_ac_temp": "Temperature in Boost preset for AC mode",
"use_presets_central_config": "Check to use the central presets configuration. Uncheck to use a specific presets configuration for this VTherm"
}
},
"window": {
@@ -428,25 +427,10 @@
"description": "Presence management attributes.\nGives the a presence sensor of your home (true is someone is present) and give the corresponding temperature preset setting.",
"data": {
"presence_sensor_entity_id": "Presence sensor",
"eco_away_temp": "Eco away preset",
"comfort_away_temp": "Comfort away preset",
"boost_away_temp": "Boost away preset",
"frost_away_temp": "Frost protection preset",
"eco_ac_away_temp": "Eco away preset in AC mode",
"comfort_ac_away_temp": "Comfort away preset in AC mode",
"boost_ac_away_temp": "Boost away preset in AC mode",
"use_presence_central_config": "Use central presence configuration"
"use_presence_central_config": "Use central presence temperature configuration. Uncheck to use specific temperature entities"
},
"data_description": {
"presence_sensor_entity_id": "Presence sensor entity id",
"eco_away_temp": "Temperature in Eco preset when no presence",
"comfort_away_temp": "Temperature in Comfort preset when no presence",
"boost_away_temp": "Temperature in Boost preset when no presence",
"frost_away_temp": "Temperature in Frost protection preset when no presence",
"eco_ac_away_temp": "Temperature in Eco preset when no presence in AC mode",
"comfort_ac_away_temp": "Temperature in Comfort preset when no presence in AC mode",
"boost_ac_away_temp": "Temperature in Boost preset when no presence in AC mode",
"use_presence_central_config": "Check to use the central presence configuration. Uncheck to use a specific presence configuration for this VTherm"
"presence_sensor_entity_id": "Presence sensor entity id"
}
},
"advanced": {
@@ -539,9 +523,6 @@
}
},
"number": {
"temperature": {
"name": "{preset}{ac}-{away} [%key:component::sensor::entity_component::temperature::name%]"
},
"frost_temp": {
"name": "Frost"
},

View File

@@ -12,6 +12,24 @@
"thermostat_type": "Un seul thermostat de type Configuration centrale est possible."
}
},
"menu": {
"title": "Menu",
"description": "Paramétrez votre thermostat. Vous pourrez finaliser la configuration quand tous les paramètres auront été saisis.",
"menu_options": {
"main": "Principaux Attributs",
"central_boiler": "Chauffage central",
"type": "Sous-jacents",
"tpi": "Paramètres TPI",
"features": "Fonctions",
"presets": "Pre-réglages",
"window": "Détection d'ouverture",
"motion": "Détection de mouvement",
"power": "Gestion de la puissance",
"presence": "Détection de présence",
"advanced": "Paramètres avancés",
"finalize": "Finaliser la création"
}
},
"main": {
"title": "Ajout d'un nouveau thermostat",
"description": "Principaux attributs obligatoires",
@@ -26,11 +44,7 @@
"step_temperature": "Pas de température",
"device_power": "Puissance de l'équipement",
"use_central_mode": "Autoriser le controle par une entity centrale ('nécessite une config. centrale`). Cochez pour autoriser le contrôle du VTherm par la liste déroulante 'central_mode' de l'entité configuration centrale.",
"use_window_feature": "Avec détection des ouvertures",
"use_motion_feature": "Avec détection de mouvement",
"use_power_feature": "Avec gestion de la puissance",
"use_presence_feature": "Avec détection de présence",
"use_main_central_config": "Utiliser la configuration centrale. Cochez pour utiliser la configuration centrale. Décochez et saisissez les attributs pour utiliser une configuration spécifique.",
"use_main_central_config": "Utiliser la configuration centrale supplémentaire. Cochez pour utiliser la configuration centrale supplémentaire (température externe, min, max, pas, ...)",
"add_central_boiler_control": "Ajouter une chaudière centrale. Cochez pour ajouter un controle sur une chaudière centrale. Vous devrez ensuite configurer les VTherms qui commande la chaudière centrale pour que cette option prenne effet. Si au moins un des VTherm a besoin de chauffer, la chaudière centrale sera activée. Si aucun VTherm n'a besoin de chauffer, elle sera éteinte. Les commandes pour allumer/éteindre la chaudière centrale sont données dans la page de configuration suivante.",
"used_by_controls_central_boiler": "Utilisé par la chaudière centrale. Cochez si ce VTherm doit contrôler la chaudière centrale."
},
@@ -38,6 +52,16 @@
"external_temperature_sensor_entity_id": "Entity id du capteur de température extérieure."
}
},
"features": {
"title": "Fonctions",
"description": "Fonctions du thermostat à utiliser",
"data": {
"use_window_feature": "Avec détection des ouvertures",
"use_motion_feature": "Avec détection de mouvement",
"use_power_feature": "Avec gestion de la puissance",
"use_presence_feature": "Avec détection de présence"
}
},
"type": {
"title": "Entité(s) liée(s)",
"description": "Attributs de(s) l'entité(s) liée(s)",
@@ -103,27 +127,10 @@
}
},
"presets": {
"title": "Presets",
"description": "Pour chaque preset, donnez la température cible (0 pour ignorer le preset)",
"title": "Pre-réglages",
"description": "Cochez pour que ce thermostat utilise les pré-réglages de la configuration centrale. Décochez pour utiliser des entités de température spécifiques",
"data": {
"eco_temp": "Preset Eco",
"comfort_temp": "Preset Comfort",
"boost_temp": "Preset Boost",
"frost_temp": "Preset Hors-gel",
"eco_ac_temp": "Preset Eco en mode AC",
"comfort_ac_temp": "Preset Comfort en mode AC",
"boost_ac_temp": "Preset Boost en mode AC",
"use_presets_central_config": "Utiliser la configuration des presets centrale"
},
"data_description": {
"eco_temp": "Température en preset Eco",
"comfort_temp": "Température en preset Comfort",
"boost_temp": "Température en preset Boost",
"frost_temp": "Température en preset Hors-gel",
"eco_ac_temp": "Température en preset Eco en mode AC",
"comfort_ac_temp": "Température en preset Comfort en mode AC",
"boost_ac_temp": "Température en preset Boost en mode AC",
"use_presets_central_config": "Cochez pour utiliser la configuration des presets centrale. Décochez et saisissez les attributs pour utiliser une configuration des presets spécifique"
"use_presets_central_config": "Utiliser la configuration des pré-réglages centrale"
}
},
"window": {
@@ -189,25 +196,10 @@
"description": "Donnez un capteur de présence (true si quelqu'un est présent) et les températures cibles à utiliser en cas d'abs.",
"data": {
"presence_sensor_entity_id": "Capteur de présence",
"eco_away_temp": "preset Eco",
"comfort_away_temp": "preset Comfort",
"boost_away_temp": "preset Boost",
"frost_away_temp": "preset Hors-gel",
"eco_ac_away_temp": "preset Eco en mode AC",
"comfort_ac_away_temp": "preset Comfort en mode AC",
"boost_ac_away_temp": "preset Boost en mode AC",
"use_presence_central_config": "Utiliser la configuration centrale de la présence"
"use_presence_central_config": "Utiliser la configuration centrale des températures en cas d'absence. Décochez pour avoir des entités de température dédiées"
},
"data_description": {
"presence_sensor_entity_id": "Id d'entité du capteur de présence",
"eco_away_temp": "Température en preset Eco en cas d'abs",
"comfort_away_temp": "Température en preset Comfort en cas d'abs",
"boost_away_temp": "Température en preset Boost en cas d'abs",
"frost_away_temp": "Température en preset Hors-gel en cas d'abs",
"eco_ac_away_temp": "Température en preset Eco en cas d'abs en mode AC",
"comfort_ac_away_temp": "Température en preset Comfort en cas d'abs en mode AC",
"boost_ac_away_temp": "Température en preset Boost en cas d'abs en mode AC",
"use_presence_central_config": "Cochez pour utiliser la configuration centrale de la présence. Décochez et saisissez les attributs pour utiliser une configuration spécifique de la présence"
"presence_sensor_entity_id": "Id d'entité du capteur de présence"
}
},
"advanced": {
@@ -263,6 +255,24 @@
"thermostat_type": "Un seul thermostat de type Configuration centrale est possible."
}
},
"menu": {
"title": "Menu",
"description": "Paramétrez votre thermostat. Vous pourrez finaliser la configuration quand tous les paramètres auront été saisis.",
"menu_options": {
"main": "Principaux Attributs",
"central_boiler": "Chauffage central",
"type": "Sous-jacents",
"tpi": "Paramètres TPI",
"features": "Fonctions",
"presets": "Pre-réglages",
"window": "Détection d'ouvertures",
"motion": "Détection de mouvement",
"power": "Gestion de la puissance",
"presence": "Détection de présence",
"advanced": "Paramètres avancés",
"finalize": "Finaliser les modifications"
}
},
"main": {
"title": "Attributs - {name}",
"description": "Principaux attributs obligatoires",
@@ -277,11 +287,7 @@
"step_temperature": "Pas de température",
"device_power": "Puissance de l'équipement",
"use_central_mode": "Autoriser le controle par une entity centrale ('nécessite une config. centrale`). Cochez pour autoriser le contrôle du VTherm par la liste déroulante 'central_mode' de l'entité configuration centrale.",
"use_window_feature": "Avec détection des ouvertures",
"use_motion_feature": "Avec détection de mouvement",
"use_power_feature": "Avec gestion de la puissance",
"use_presence_feature": "Avec détection de présence",
"use_main_central_config": "Utiliser la configuration centrale. Cochez pour utiliser la configuration centrale. Décochez et saisissez les attributs pour utiliser une configuration spécifique.",
"use_main_central_config": "Utiliser la configuration centrale supplémentaire. Cochez pour utiliser la configuration centrale supplémentaire (température externe, min, max, pas, ...).",
"add_central_boiler_control": "Ajouter une chaudière centrale. Cochez pour ajouter un controle sur une chaudière centrale. Vous devrez ensuite configurer les VTherms qui commande la chaudière centrale pour que cette option prenne effet. Si au moins un des VTherm a besoin de chauffer, la chaudière centrale sera activée. Si aucun VTherm n'a besoin de chauffer, elle sera éteinte. Les commandes pour allumer/éteindre la chaudière centrale sont données dans la page de configuration suivante.",
"used_by_controls_central_boiler": "Utilisé par la chaudière centrale. Cochez si ce VTherm doit contrôler la chaudière centrale."
},
@@ -289,6 +295,16 @@
"external_temperature_sensor_entity_id": "Entity id du capteur de température extérieure. N'est pas utilisé si la configuration centrale est utilisée."
}
},
"features": {
"title": "Fonctions - {name}",
"description": "Fonctions du thermostat à utiliser",
"data": {
"use_window_feature": "Avec détection des ouvertures",
"use_motion_feature": "Avec détection de mouvement",
"use_power_feature": "Avec gestion de la puissance",
"use_presence_feature": "Avec détection de présence"
}
},
"type": {
"title": "Entités - {name}",
"description": "Attributs de(s) l'entité(s) liée(s)",
@@ -349,26 +365,9 @@
},
"presets": {
"title": "Pre-réglages - {name}",
"description": "Réglage des presets. Donnez la température cible (0 pour ignorer le preset)",
"description": "Cochez pour que ce thermostat utilise les pré-réglages de la configuration centrale. Décochez pour utiliser des entités de température spécifiques",
"data": {
"eco_temp": "Preset Eco",
"comfort_temp": "Preset Comfort",
"boost_temp": "Preset Boost",
"frost_temp": "Preset Hors-gel",
"eco_ac_temp": "Preset Eco en mode AC",
"comfort_ac_temp": "Preset Comfort en mode AC",
"boost_ac_temp": "Preset Boost en mode AC",
"use_presets_central_config": "Utiliser la configuration centrale des presets"
},
"data_description": {
"eco_temp": "Température en preset Eco",
"comfort_temp": "Température en preset Comfort",
"boost_temp": "Température en preset Boost",
"frost_temp": "Température en preset Hors-gel",
"eco_ac_temp": "Température en preset Eco en mode AC",
"comfort_ac_temp": "Température en preset Comfort en mode AC",
"boost_ac_temp": "Température en preset Boost en mode AC",
"use_presets_central_config": "Cochez pour utiliser la configuration centrale des presets. Décochez et saisissez les attributs pour utiliser une configuration des presets spécifique"
"use_presets_central_config": "Utiliser la configuration des pré-réglages centrale"
}
},
"window": {
@@ -434,25 +433,10 @@
"description": "Donnez un capteur de présence (true si quelqu'un est présent) et les températures cibles à utiliser en cas d'abs.",
"data": {
"presence_sensor_entity_id": "Capteur de présence",
"eco_away_temp": "preset Eco",
"comfort_away_temp": "preset Comfort",
"boost_away_temp": "preset Boost",
"frost_away_temp": "preset Hors-gel",
"eco_ac_away_temp": "preset Eco en mode AC",
"comfort_ac_away_temp": "preset Comfort en mode AC",
"boost_ac_away_temp": "preset Boost en mode AC",
"use_presence_central_config": "Utiliser la configuration centrale de la présence"
"use_presence_central_config": "Utiliser la configuration centrale des températures en cas d'absence. Décochez pour avoir des entités de température dédiées"
},
"data_description": {
"presence_sensor_entity_id": "Id d'entité du capteur de présence",
"eco_away_temp": "Température en preset Eco en cas d'abs",
"comfort_away_temp": "Température en preset Comfort en cas d'abs",
"boost_away_temp": "Température en preset Boost en cas d'abs",
"frost_away_temp": "Température en preset Hors-gel en cas d'abs",
"eco_ac_away_temp": "Température en preset Eco en cas d'abs en mode AC",
"comfort_ac_away_temp": "Température en preset Comfort en cas d'abs en mode AC",
"boost_ac_away_temp": "Température en preset Boost en cas d'abs en mode AC",
"use_presence_central_config": "Cochez pour utiliser la configuration centrale de la présence. Décochez et saisissez les attributs pour utiliser une configuration spécifique de la présence"
"presence_sensor_entity_id": "Id d'entité du capteur de présence"
}
},
"advanced": {
@@ -557,9 +541,6 @@
}
},
"number": {
"temperature": {
"name": "{preset}{ac}-{away} [%key:component::sensor::entity_component::temperature::name%]"
},
"frost_temp": {
"name": "Hors gel "
},

View File

@@ -23,9 +23,7 @@ from homeassistant.components.switch import (
SwitchEntity,
)
from homeassistant.components.number import (
NumberEntity,
)
from homeassistant.components.number import NumberEntity, DOMAIN as NUMBER_DOMAIN
from pytest_homeassistant_custom_component.common import MockConfigEntry
@@ -854,3 +852,25 @@ def cancel_switchs_cycles(entity: BaseThermostat):
return
for under in entity._underlyings:
under._cancel_cycle()
async def set_climate_preset_temp(
entity: BaseThermostat, temp_number_name: str, temp: float
):
"""Set a preset value in the temp Number entity"""
number_entity_id = (
NUMBER_DOMAIN
+ "."
+ entity.entity_id.split(".")[1]
+ "_"
+ temp_number_name
+ PRESET_TEMP_SUFFIX
)
temp_entity = search_entity(
entity.hass,
number_entity_id,
NUMBER_DOMAIN,
)
if temp_entity:
await temp_entity.async_set_native_value(temp)

View File

@@ -138,6 +138,7 @@ MOCK_TH_OVER_CLIMATE_TYPE_AC_CONFIG = {
CONF_AUTO_REGULATION_PERIOD_MIN: 1,
}
# TODO remove this later
MOCK_PRESETS_CONFIG = {
PRESET_FROST_PROTECTION + PRESET_TEMP_SUFFIX: 7,
PRESET_ECO + PRESET_TEMP_SUFFIX: 16,
@@ -145,6 +146,7 @@ MOCK_PRESETS_CONFIG = {
PRESET_BOOST + PRESET_TEMP_SUFFIX: 18,
}
# TODO remove this later
MOCK_PRESETS_AC_CONFIG = {
PRESET_FROST_PROTECTION + PRESET_TEMP_SUFFIX: 7,
PRESET_ECO + PRESET_TEMP_SUFFIX: 17,
@@ -188,20 +190,10 @@ MOCK_POWER_CONFIG = {
MOCK_PRESENCE_CONFIG = {
CONF_PRESENCE_SENSOR: "person.presence_sensor",
PRESET_ECO + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 16,
PRESET_COMFORT + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 17,
PRESET_BOOST + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 18,
}
MOCK_PRESENCE_AC_CONFIG = {
CONF_PRESENCE_SENSOR: "person.presence_sensor",
PRESET_FROST_PROTECTION + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 7,
PRESET_ECO + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 16,
PRESET_COMFORT + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 17,
PRESET_BOOST + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 18,
PRESET_ECO + PRESET_AC_SUFFIX + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 27,
PRESET_COMFORT + PRESET_AC_SUFFIX + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 26,
PRESET_BOOST + PRESET_AC_SUFFIX + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 25,
}
MOCK_ADVANCED_CONFIG = {

View File

@@ -205,14 +205,6 @@ async def test_user_config_flow_over_climate(
result["flow_id"], user_input={CONF_USE_PRESETS_CENTRAL_CONFIG: False}
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["step_id"] == "presets"
assert result["errors"] == {}
result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input=MOCK_PRESETS_CONFIG
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["step_id"] == "advanced"
assert result["errors"] == {}
@@ -232,7 +224,7 @@ async def test_user_config_flow_over_climate(
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result[
"data"
] == MOCK_TH_OVER_CLIMATE_USER_CONFIG | MOCK_TH_OVER_CLIMATE_MAIN_CONFIG | MOCK_TH_OVER_CLIMATE_CENTRAL_MAIN_CONFIG | MOCK_TH_OVER_CLIMATE_TYPE_CONFIG | MOCK_PRESETS_CONFIG | MOCK_ADVANCED_CONFIG | MOCK_DEFAULT_FEATURE_CONFIG | {
] == MOCK_TH_OVER_CLIMATE_USER_CONFIG | MOCK_TH_OVER_CLIMATE_MAIN_CONFIG | MOCK_TH_OVER_CLIMATE_CENTRAL_MAIN_CONFIG | MOCK_TH_OVER_CLIMATE_TYPE_CONFIG | MOCK_ADVANCED_CONFIG | MOCK_DEFAULT_FEATURE_CONFIG | {
CONF_USE_MAIN_CENTRAL_CONFIG: False,
CONF_USE_TPI_CENTRAL_CONFIG: False,
CONF_USE_PRESETS_CENTRAL_CONFIG: False,
@@ -502,11 +494,11 @@ async def test_user_config_flow_over_4_switches(
await create_central_config(hass)
SOURCE_CONFIG = {
SOURCE_CONFIG = { # pylint: disable=invalid-name
CONF_THERMOSTAT_TYPE: CONF_THERMOSTAT_SWITCH,
}
MAIN_CONFIG = { # pylint: disable=wildcard-import, invalid-name
MAIN_CONFIG = { # pylint: disable=invalid-name
CONF_NAME: "TheOver4SwitchMockName",
CONF_TEMP_SENSOR: "sensor.mock_temp_sensor",
CONF_CYCLE_MIN: 5,
@@ -520,7 +512,7 @@ async def test_user_config_flow_over_4_switches(
CONF_USED_BY_CENTRAL_BOILER: False,
}
TYPE_CONFIG = { # pylint: disable=wildcard-import, invalid-name
TYPE_CONFIG = { # pylint: disable=invalid-name
CONF_HEATER: "switch.mock_switch1",
CONF_HEATER_2: "switch.mock_switch2",
CONF_HEATER_3: "switch.mock_switch3",

View File

@@ -56,6 +56,23 @@ async def test_over_switch_ac_full_start(
assert entity
assert isinstance(entity, ThermostatOverSwitch)
# Initialise the preset temp
await set_climate_preset_temp(
entity, PRESET_FROST_PROTECTION + PRESET_AWAY_SUFFIX, 7
)
await set_climate_preset_temp(entity, PRESET_ECO + PRESET_AWAY_SUFFIX, 16)
await set_climate_preset_temp(entity, PRESET_COMFORT + PRESET_AWAY_SUFFIX, 17)
await set_climate_preset_temp(entity, PRESET_BOOST + PRESET_AWAY_SUFFIX, 18)
await set_climate_preset_temp(
entity, PRESET_ECO + PRESET_AC_SUFFIX + PRESET_AWAY_SUFFIX, 27
)
await set_climate_preset_temp(
entity, PRESET_COMFORT + PRESET_AC_SUFFIX + PRESET_AWAY_SUFFIX, 26
)
await set_climate_preset_temp(
entity, PRESET_BOOST + PRESET_AC_SUFFIX + PRESET_AWAY_SUFFIX, 25
)
assert entity.name == "TheOverSwitchMockName"
assert entity.is_over_climate is False # pylint: disable=protected-access
assert entity.ac_mode is True