diff --git a/custom_components/versatile_thermostat/config_flow.py b/custom_components/versatile_thermostat/config_flow.py index 078b3ce..30ff05c 100644 --- a/custom_components/versatile_thermostat/config_flow.py +++ b/custom_components/versatile_thermostat/config_flow.py @@ -204,6 +204,7 @@ class VersatileThermostatBaseConfigFlow(FlowHandler): vol.Required(CONF_CYCLE_MIN, default=5): cv.positive_int, vol.Required(CONF_TEMP_MIN, default=7): vol.Coerce(float), vol.Required(CONF_TEMP_MAX, default=35): vol.Coerce(float), + vol.Optional(CONF_DEVICE_POWER, default="1"): vol.Coerce(float), 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, @@ -290,7 +291,6 @@ class VersatileThermostatBaseConfigFlow(FlowHandler): domain=[SENSOR_DOMAIN, INPUT_NUMBER_DOMAIN] ), ), # vol.In(power_sensors), - vol.Optional(CONF_DEVICE_POWER, default="1"): vol.Coerce(float), vol.Optional(CONF_PRESET_POWER, default="13"): vol.Coerce(float), } ) diff --git a/custom_components/versatile_thermostat/strings.json b/custom_components/versatile_thermostat/strings.json index c92c60c..4c866fd 100644 --- a/custom_components/versatile_thermostat/strings.json +++ b/custom_components/versatile_thermostat/strings.json @@ -14,6 +14,7 @@ "cycle_min": "Cycle duration (minutes)", "temp_min": "Minimal temperature allowed", "temp_max": "Maximal temperature allowed", + "device_power": "Device power (kW)", "use_window_feature": "Use window detection", "use_motion_feature": "Use motion detection", "use_power_feature": "Use power management", @@ -70,7 +71,6 @@ "data": { "power_sensor_entity_id": "Power sensor entity id", "max_power_sensor_entity_id": "Max power sensor entity id", - "device_power": "Device power (kW)", "power_temp": "Temperature for Power shedding" } }, @@ -117,6 +117,7 @@ "cycle_min": "Cycle duration (minutes)", "temp_min": "Minimal temperature allowed", "temp_max": "Maximal temperature allowed", + "device_power": "Device power (kW)", "use_window_feature": "Use window detection", "use_motion_feature": "Use motion detection", "use_power_feature": "Use power management", @@ -173,7 +174,6 @@ "data": { "power_sensor_entity_id": "Power sensor entity id", "max_power_sensor_entity_id": "Max power sensor entity id", - "device_power": "Device power (kW)", "power_temp": "Temperature for Power shedding" } }, diff --git a/custom_components/versatile_thermostat/tests/const.py b/custom_components/versatile_thermostat/tests/const.py index 45cf9e8..7a80bdf 100644 --- a/custom_components/versatile_thermostat/tests/const.py +++ b/custom_components/versatile_thermostat/tests/const.py @@ -51,6 +51,7 @@ MOCK_TH_OVER_SWITCH_USER_CONFIG = { CONF_CYCLE_MIN: 5, CONF_TEMP_MIN: 15, CONF_TEMP_MAX: 30, + CONF_DEVICE_POWER: 1, CONF_USE_WINDOW_FEATURE: True, CONF_USE_MOTION_FEATURE: True, CONF_USE_POWER_FEATURE: True, @@ -65,6 +66,7 @@ MOCK_TH_OVER_CLIMATE_USER_CONFIG = { CONF_CYCLE_MIN: 5, CONF_TEMP_MIN: 15, CONF_TEMP_MAX: 30, + CONF_DEVICE_POWER: 1, # Keep default values which are False } @@ -103,7 +105,6 @@ MOCK_MOTION_CONFIG = { MOCK_POWER_CONFIG = { CONF_POWER_SENSOR: "sensor.power_sensor", CONF_MAX_POWER_SENSOR: "sensor.power_max_sensor", - CONF_DEVICE_POWER: 1, CONF_PRESET_POWER: 10, } diff --git a/custom_components/versatile_thermostat/translations/en.json b/custom_components/versatile_thermostat/translations/en.json index cb623a2..61980e0 100644 --- a/custom_components/versatile_thermostat/translations/en.json +++ b/custom_components/versatile_thermostat/translations/en.json @@ -14,6 +14,7 @@ "cycle_min": "Cycle duration (minutes)", "temp_min": "Minimal temperature allowed", "temp_max": "Maximal temperature allowed", + "device_power": "Device power (kW)", "use_window_feature": "Use window detection", "use_motion_feature": "Use motion detection", "use_power_feature": "Use power management", @@ -70,7 +71,6 @@ "data": { "power_sensor_entity_id": "Power sensor entity id", "max_power_sensor_entity_id": "Max power sensor entity id", - "device_power": "Device power (kW)", "power_temp": "Temperature for Power shedding" } }, @@ -117,6 +117,7 @@ "cycle_min": "Cycle duration (minutes)", "temp_min": "Minimal temperature allowed", "temp_max": "Maximal temperature allowed", + "device_power": "Device power (kW)", "use_window_feature": "Use window detection", "use_motion_feature": "Use motion detection", "use_power_feature": "Use power management", @@ -173,7 +174,6 @@ "data": { "power_sensor_entity_id": "Power sensor entity id", "max_power_sensor_entity_id": "Max power sensor entity id", - "device_power": "Device power (kW)", "power_temp": "Temperature for Power shedding" } }, diff --git a/custom_components/versatile_thermostat/translations/fr.json b/custom_components/versatile_thermostat/translations/fr.json index 6326256..35afcde 100644 --- a/custom_components/versatile_thermostat/translations/fr.json +++ b/custom_components/versatile_thermostat/translations/fr.json @@ -13,6 +13,7 @@ "cycle_min": "Durée du cycle (minutes)", "temp_min": "Température minimale permise", "temp_max": "Température maximale permise", + "device_power": "Puissance de l'équipement", "use_window_feature": "Avec détection des ouvertures", "use_motion_feature": "Avec détection de mouvement", "use_power_feature": "Avec gestion de la puissance", @@ -69,7 +70,6 @@ "data": { "power_sensor_entity_id": "Capteur de puissance totale (entity id)", "max_power_sensor_entity_id": "Capteur de puissance Max (entity id)", - "device_power": "Puissance de l'équipement", "power_temp": "Température si délestaqe" } }, @@ -117,6 +117,7 @@ "cycle_min": "Durée du cycle (minutes)", "temp_min": "Température minimale permise", "temp_max": "Température maximale permise", + "device_power": "Puissance de l'équipement", "use_window_feature": "Avec détection des ouvertures", "use_motion_feature": "Avec détection de mouvement", "use_power_feature": "Avec gestion de la puissance", @@ -173,7 +174,6 @@ "data": { "power_sensor_entity_id": "Capteur de puissance totale (entity id)", "max_power_sensor_entity_id": "Capteur de puissance Max (entity id)", - "device_power": "Puissance de l'équipement", "power_temp": "Température si délestaqe" } },