Migrate openweathermap to use async_update_entry to alter config entries (#110372)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
J. Nick Koston 2024-02-12 13:15:57 -06:00 committed by GitHub
parent fc1c513f33
commit a1f0e9015b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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