From 303bb99da050715ac2d50b45f1940552265e5c94 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 12 Feb 2024 01:28:54 -0600 Subject: [PATCH] Migrate huawei_lte to use async_update_entry to alter config entries (#110309) --- homeassistant/components/huawei_lte/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/huawei_lte/__init__.py b/homeassistant/components/huawei_lte/__init__.py index 29c59d3ff9c..81be4e462d1 100644 --- a/homeassistant/components/huawei_lte/__init__.py +++ b/homeassistant/components/huawei_lte/__init__.py @@ -557,14 +557,12 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> recipient = options.get(CONF_RECIPIENT) if isinstance(recipient, str): options[CONF_RECIPIENT] = [x.strip() for x in recipient.split(",")] - config_entry.version = 2 - hass.config_entries.async_update_entry(config_entry, options=options) + hass.config_entries.async_update_entry(config_entry, options=options, version=2) _LOGGER.info("Migrated config entry to version %d", config_entry.version) if config_entry.version == 2: - config_entry.version = 3 data = dict(config_entry.data) data[CONF_MAC] = [] - hass.config_entries.async_update_entry(config_entry, data=data) + hass.config_entries.async_update_entry(config_entry, data=data, version=3) _LOGGER.info("Migrated config entry to version %d", config_entry.version) # There can be no longer needed *_from_yaml data and options things left behind # from pre-2022.4ish; they can be removed while at it when/if we eventually bump and