Skip to content

Commit

Permalink
Migrate function
Browse files Browse the repository at this point in the history
  • Loading branch information
theneweinstein committed Feb 24, 2024
1 parent 2d579c6 commit 3d1c9f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions custom_components/somneo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/somneo/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3d1c9f5

Please sign in to comment.