mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
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:
parent
fc1c513f33
commit
a1f0e9015b
@ -78,10 +78,11 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
mode = FORECAST_MODE_ONECALL_DAILY
|
mode = FORECAST_MODE_ONECALL_DAILY
|
||||||
|
|
||||||
new_data = {**data, CONF_MODE: mode}
|
new_data = {**data, CONF_MODE: mode}
|
||||||
version = entry.version = CONFIG_FLOW_VERSION
|
config_entries.async_update_entry(
|
||||||
config_entries.async_update_entry(entry, data=new_data)
|
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
|
return True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user