Skip to content

Commit

Permalink
Compatibility with HA 2024.9
Browse files Browse the repository at this point in the history
  • Loading branch information
kamaradclimber committed Aug 27, 2024
1 parent 41fe29c commit 9cb8d52
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions custom_components/rte_ecowatt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,16 +562,14 @@ async def async_migrate_entry(hass, config_entry: ConfigEntry):
)
new = {**config_entry.data}
new["enedis_load_shedding"] = [False]
config_entry.version = 2
hass.config_entries.async_update_entry(config_entry, data=new)
hass.config_entries.async_update_entry(config_entry, data=new, version=2)
_LOGGER.info(f"Migration to version {config_entry.version} successful")
if config_entry.version < 3:
_LOGGER.warn(
f"config_entry version is {config_entry.version}, migrating to version 3"
)
new = {**config_entry.data}
del new["enedis_load_shedding"]
config_entry.version = 3
hass.config_entries.async_update_entry(config_entry, data=new)
hass.config_entries.async_update_entry(config_entry, data=new, version=3)
_LOGGER.info(f"Migration to version {config_entry.version} successful")
return True

0 comments on commit 9cb8d52

Please sign in to comment.