mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Generic Thermostat Add Target Min Max to UI config (#131168)
Currently you can configure the minium and maximum target temperatures if you create a generic thermostat in YAML. If you create it via the UI, there is no option to configure them, you just get the climate domain defaults. This commit adds minimum and maximum fields to the first stage of the generic thermostat config flow, so that UI users can also set min and max. Min and max are important as usually users want to select target temperatures within a relatively narrow band, while the defaults create a wide band. The wide band makes it hard to be accurate enough with the arc style temperatue selector on the thermostat card.
This commit is contained in:
parent
a405d2b724
commit
bb51837346
@ -63,7 +63,9 @@ from .const import (
|
||||
CONF_COLD_TOLERANCE,
|
||||
CONF_HEATER,
|
||||
CONF_HOT_TOLERANCE,
|
||||
CONF_MAX_TEMP,
|
||||
CONF_MIN_DUR,
|
||||
CONF_MIN_TEMP,
|
||||
CONF_PRESETS,
|
||||
CONF_SENSOR,
|
||||
DEFAULT_TOLERANCE,
|
||||
@ -77,8 +79,6 @@ DEFAULT_NAME = "Generic Thermostat"
|
||||
|
||||
CONF_INITIAL_HVAC_MODE = "initial_hvac_mode"
|
||||
CONF_KEEP_ALIVE = "keep_alive"
|
||||
CONF_MIN_TEMP = "min_temp"
|
||||
CONF_MAX_TEMP = "max_temp"
|
||||
CONF_PRECISION = "precision"
|
||||
CONF_TARGET_TEMP = "target_temp"
|
||||
CONF_TEMP_STEP = "target_temp_step"
|
||||
|
@ -21,7 +21,9 @@ from .const import (
|
||||
CONF_COLD_TOLERANCE,
|
||||
CONF_HEATER,
|
||||
CONF_HOT_TOLERANCE,
|
||||
CONF_MAX_TEMP,
|
||||
CONF_MIN_DUR,
|
||||
CONF_MIN_TEMP,
|
||||
CONF_PRESETS,
|
||||
CONF_SENSOR,
|
||||
DEFAULT_TOLERANCE,
|
||||
@ -57,6 +59,16 @@ OPTIONS_SCHEMA = {
|
||||
vol.Optional(CONF_MIN_DUR): selector.DurationSelector(
|
||||
selector.DurationSelectorConfig(allow_negative=False)
|
||||
),
|
||||
vol.Optional(CONF_MIN_TEMP): selector.NumberSelector(
|
||||
selector.NumberSelectorConfig(
|
||||
mode=selector.NumberSelectorMode.BOX, unit_of_measurement=DEGREE, step=0.1
|
||||
)
|
||||
),
|
||||
vol.Optional(CONF_MAX_TEMP): selector.NumberSelector(
|
||||
selector.NumberSelectorConfig(
|
||||
mode=selector.NumberSelectorMode.BOX, unit_of_measurement=DEGREE, step=0.1
|
||||
)
|
||||
),
|
||||
}
|
||||
|
||||
PRESETS_SCHEMA = {
|
||||
|
@ -18,7 +18,9 @@ CONF_AC_MODE = "ac_mode"
|
||||
CONF_COLD_TOLERANCE = "cold_tolerance"
|
||||
CONF_HEATER = "heater"
|
||||
CONF_HOT_TOLERANCE = "hot_tolerance"
|
||||
CONF_MAX_TEMP = "max_temp"
|
||||
CONF_MIN_DUR = "min_cycle_duration"
|
||||
CONF_MIN_TEMP = "min_temp"
|
||||
CONF_PRESETS = {
|
||||
p: f"{p}_temp"
|
||||
for p in (
|
||||
|
@ -12,7 +12,9 @@
|
||||
"min_cycle_duration": "Minimum cycle duration",
|
||||
"name": "[%key:common::config_flow::data::name%]",
|
||||
"cold_tolerance": "Cold tolerance",
|
||||
"hot_tolerance": "Hot tolerance"
|
||||
"hot_tolerance": "Hot tolerance",
|
||||
"min_temp": "Minimum target temperature",
|
||||
"max_temp": "Maximum target temperature"
|
||||
},
|
||||
"data_description": {
|
||||
"ac_mode": "Set the actuator specified to be treated as a cooling device instead of a heating device.",
|
||||
@ -45,7 +47,9 @@
|
||||
"target_sensor": "[%key:component::generic_thermostat::config::step::user::data::target_sensor%]",
|
||||
"min_cycle_duration": "[%key:component::generic_thermostat::config::step::user::data::min_cycle_duration%]",
|
||||
"cold_tolerance": "[%key:component::generic_thermostat::config::step::user::data::cold_tolerance%]",
|
||||
"hot_tolerance": "[%key:component::generic_thermostat::config::step::user::data::hot_tolerance%]"
|
||||
"hot_tolerance": "[%key:component::generic_thermostat::config::step::user::data::hot_tolerance%]",
|
||||
"min_temp": "[%key:component::generic_thermostat::config::step::user::data::min_temp%]",
|
||||
"max_temp": "[%key:component::generic_thermostat::config::step::user::data::max_temp%]"
|
||||
},
|
||||
"data_description": {
|
||||
"heater": "[%key:component::generic_thermostat::config::step::user::data_description::heater%]",
|
||||
|
Loading…
x
Reference in New Issue
Block a user