Remove unnecessary calls to `async_update_entry` from `async_migrate_entry` (#90575)

This commit is contained in:
Erik Montnemery 2023-03-31 15:53:35 +02:00 committed by GitHub
parent 1ca7f0dc6a
commit 3467f4674e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 0 additions and 7 deletions

View File

@ -380,7 +380,6 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
)
else:
entry.version = version
hass.config_entries.async_update_entry(entry)
LOGGER.info("Migration to version %s successful", version)

View File

@ -117,7 +117,6 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
en_reg.async_clear_config_entry(entry.entry_id)
version = entry.version = 2
hass.config_entries.async_update_entry(entry)
LOGGER.info("Migration to version %s successful", version)

View File

@ -51,7 +51,6 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
if config_entry.version != 3:
# Home Assistant 2023.2
config_entry.version = 3
hass.config_entries.async_update_entry(config_entry)
_LOGGER.info("Migration to version %s successful", config_entry.version)

View File

@ -67,7 +67,6 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
await async_migrate_entries(
hass, config_entry.entry_id, update_entity_unique_id
)
hass.config_entries.async_update_entry(config_entry)
_LOGGER.info("Migration to version %s successful", config_entry.version)

View File

@ -340,7 +340,6 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
en_reg.async_clear_config_entry(config_entry.entry_id)
version = config_entry.version = 2
hass.config_entries.async_update_entry(config_entry)
LOGGER.debug("Migration to version %s successful", version)
return True

View File

@ -210,8 +210,6 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
await hass.async_add_executor_job(shutil.rmtree, cache_path)
# set the new version
config_entry.version = 2
# update the entry
hass.config_entries.async_update_entry(config_entry)
_LOGGER.debug("Migration to version %s successful", config_entry.version)
return True