Skip to content

Commit

Permalink
Merge pull request #206 from tykeal/allow_short_events
Browse files Browse the repository at this point in the history
Chore: Cleanup migrations of schemas
  • Loading branch information
tykeal authored Jun 15, 2024
2 parents 99a983a + cdd41d6 commit 9f90ab9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions custom_components/rental_control/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
entry=config_entry,
unique_id=gen_uuid(data[CONF_CREATION_DATETIME]),
data=data,
version=2,
)
config_entry.version = 2
version = 2
_LOGGER.debug("Migration to version %s complete", config_entry.version)

Expand All @@ -220,9 +220,9 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
entry=config_entry,
unique_id=config_entry.unique_id,
data=data,
version=3,
)

config_entry.version = 3
version = 3
_LOGGER.debug("Migration to version %s complete", config_entry.version)

Expand All @@ -236,9 +236,9 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
entry=config_entry,
unique_id=config_entry.unique_id,
data=data,
version=4,
)

config_entry.version = 4
version = 4
_LOGGER.debug("Migration to version %s complete", config_entry.version)

Expand All @@ -252,9 +252,9 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
entry=config_entry,
unique_id=config_entry.unique_id,
data=data,
version=5,
)

config_entry.version = 5
version = 5
_LOGGER.debug(f"Migration to version {config_entry.version} complete")

Expand All @@ -265,10 +265,12 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
data = config_entry.data.copy()
data.pop(CONF_PATH, None)
hass.config_entries.async_update_entry(
entry=config_entry, unique_id=config_entry.unique_id, data=data
entry=config_entry,
unique_id=config_entry.unique_id,
data=data,
version=6,
)

config_entry.version = 6
version = 6
_LOGGER.debug(f"Migration to version {config_entry.version} complete")

Expand Down

0 comments on commit 9f90ab9

Please sign in to comment.