diff --git a/custom_components/somneo/__init__.py b/custom_components/somneo/__init__.py index 2858c93..ad22dd7 100644 --- a/custom_components/somneo/__init__.py +++ b/custom_components/somneo/__init__.py @@ -85,10 +85,9 @@ async def async_migrate_entry(hass, config_entry: ConfigEntry): if config_entry.version == 3: new = {**config_entry.data} - new["options"].pop("use_session") - + options = {CONF_SESSION: True} config_entry.version = 4 - hass.config_entries.async_update_entry(config_entry, data=new) + hass.config_entries.async_update_entry(config_entry, data=new, options=options) _LOGGER.info("Migration to version %s successful", config_entry.version) diff --git a/custom_components/somneo/config_flow.py b/custom_components/somneo/config_flow.py index 65887b8..55f78df 100644 --- a/custom_components/somneo/config_flow.py +++ b/custom_components/somneo/config_flow.py @@ -51,7 +51,7 @@ def _base_schema(discovery_info: SsdpServiceInfo | None) -> vol.Schema: class SomneoConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): """Example config flow.""" - VERSION = 3 + VERSION = 4 discovery_info: SsdpServiceInfo | None = None host: str | None = None