From a1f0e9015b658ba34c3ef801580cac907b05c563 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 12 Feb 2024 13:15:57 -0600 Subject: [PATCH] Migrate openweathermap to use async_update_entry to alter config entries (#110372) Co-authored-by: Franck Nijhof --- homeassistant/components/openweathermap/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/openweathermap/__init__.py b/homeassistant/components/openweathermap/__init__.py index cfe28e2eacc..22c97d72fa5 100644 --- a/homeassistant/components/openweathermap/__init__.py +++ b/homeassistant/components/openweathermap/__init__.py @@ -78,10 +78,11 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: mode = FORECAST_MODE_ONECALL_DAILY new_data = {**data, CONF_MODE: mode} - version = entry.version = CONFIG_FLOW_VERSION - config_entries.async_update_entry(entry, data=new_data) + config_entries.async_update_entry( + entry, data=new_data, version=CONFIG_FLOW_VERSION + ) - _LOGGER.info("Migration to version %s successful", version) + _LOGGER.info("Migration to version %s successful", CONFIG_FLOW_VERSION) return True