diff --git a/custom_components/solvis_control/__init__.py b/custom_components/solvis_control/__init__.py index e2d3656..06bd543 100644 --- a/custom_components/solvis_control/__init__.py +++ b/custom_components/solvis_control/__init__.py @@ -23,8 +23,10 @@ CONF_OPTION_2, CONF_OPTION_3, CONF_OPTION_4, + CONF_OPTION_5, POLL_RATE_SLOW, POLL_RATE_DEFAULT, + CONF_OPTION_5, ) from .coordinator import SolvisModbusCoordinator @@ -139,6 +141,11 @@ async def async_migrate_entry(hass, config_entry: ConfigEntry): if POLL_RATE_SLOW not in new_data: new_data[POLL_RATE_SLOW] = 300 current_minor_version = 4 + if config_entry.minor_version < 5: + _LOGGER.info(f"Migrating from version {config_entry.version}_{config_entry.minor_version}") + if CONF_OPTION_5 not in new_data: + new_data[CONF_OPTION_5] = False + current_minor_version = 5 hass.config_entries.async_update_entry( config_entry, data=new_data, diff --git a/custom_components/solvis_control/config_flow.py b/custom_components/solvis_control/config_flow.py index cb5b8cc..7a6df67 100644 --- a/custom_components/solvis_control/config_flow.py +++ b/custom_components/solvis_control/config_flow.py @@ -23,6 +23,7 @@ CONF_OPTION_2, CONF_OPTION_3, CONF_OPTION_4, + CONF_OPTION_5, DEVICE_VERSION, POLL_RATE_DEFAULT, POLL_RATE_SLOW, @@ -68,6 +69,7 @@ def get_solvis_modules(data: ConfigType) -> Schema: vol.Required(CONF_OPTION_2, default=False): bool, # HKR 3 vol.Required(CONF_OPTION_3, default=False): bool, # solar collectors vol.Required(CONF_OPTION_4, default=False): bool, # heat pump + vol.Required(CONF_OPTION_5, default=False): bool, # room temperature } ) @@ -90,6 +92,7 @@ def get_solvis_modules_options(data: ConfigType) -> Schema: vol.Required(CONF_OPTION_2, default=data.get(CONF_OPTION_2, False)): bool, # HKR 3 vol.Required(CONF_OPTION_3, default=data.get(CONF_OPTION_3, False)): bool, # solar collectors vol.Required(CONF_OPTION_4, default=data.get(CONF_OPTION_4, False)): bool, # heat pump + vol.Required(CONF_OPTION_5, default=data.get(CONF_OPTION_5, False)): bool, # room temperature } ) @@ -116,7 +119,7 @@ def get_host_schema_options(data: ConfigType) -> Schema: class SolvisConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): VERSION = 1 - MINOR_VERSION = 4 + MINOR_VERSION = 5 def __init__(self) -> None: """Init the ConfigFlow.""" @@ -169,7 +172,7 @@ def async_get_options_flow( class SolvisOptionsFlow(config_entries.OptionsFlow): VERSION = 1 - MINOR_VERSION = 4 + MINOR_VERSION = 5 def __init__(self, config) -> None: """Init the ConfigFlow.""" diff --git a/custom_components/solvis_control/const.py b/custom_components/solvis_control/const.py index 7aecea6..303d208 100644 --- a/custom_components/solvis_control/const.py +++ b/custom_components/solvis_control/const.py @@ -17,6 +17,7 @@ CONF_OPTION_2 = "HKR3" # HKR 3 CONF_OPTION_3 = "solar collector" # Solar collector CONF_OPTION_4 = "heat pump" # heat pump +CONF_OPTION_5 = "room temperature" # room temperature DATA_COORDINATOR = "coordinator" MANUFACTURER = "Solvis" diff --git a/custom_components/solvis_control/strings.json b/custom_components/solvis_control/strings.json index 430df20..69317d5 100644 --- a/custom_components/solvis_control/strings.json +++ b/custom_components/solvis_control/strings.json @@ -27,7 +27,8 @@ "hkr2":"HKR 2", "hkr3":"HKR 3", "solar collector":"Solar Kollektoren", - "heat pump":"Wärmepumpe" + "heat pump":"Wärmepumpe", + "room temperature": "Schreiben der Raumtemperatursensoren" } } }, @@ -64,7 +65,8 @@ "hkr2":"HKR 2", "hkr3":"HKR 3", "solar collector":"Solar Kollektoren", - "heat pump":"Wärmepumpe" + "heat pump":"Wärmepumpe", + "room temperature": "Schreiben der Raumtemperatursensoren" } } }, diff --git a/custom_components/solvis_control/translations/de.json b/custom_components/solvis_control/translations/de.json index 430df20..69317d5 100644 --- a/custom_components/solvis_control/translations/de.json +++ b/custom_components/solvis_control/translations/de.json @@ -27,7 +27,8 @@ "hkr2":"HKR 2", "hkr3":"HKR 3", "solar collector":"Solar Kollektoren", - "heat pump":"Wärmepumpe" + "heat pump":"Wärmepumpe", + "room temperature": "Schreiben der Raumtemperatursensoren" } } }, @@ -64,7 +65,8 @@ "hkr2":"HKR 2", "hkr3":"HKR 3", "solar collector":"Solar Kollektoren", - "heat pump":"Wärmepumpe" + "heat pump":"Wärmepumpe", + "room temperature": "Schreiben der Raumtemperatursensoren" } } },