mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Update fyta async_migrate_entry (#116433)
Update async_migrate_entry __init__.py
This commit is contained in:
parent
fd8287bc15
commit
258e20bfc4
@ -71,8 +71,8 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
if config_entry.version == 1:
|
if config_entry.version == 1:
|
||||||
new = {**config_entry.data}
|
|
||||||
if config_entry.minor_version < 2:
|
if config_entry.minor_version < 2:
|
||||||
|
new = {**config_entry.data}
|
||||||
fyta = FytaConnector(
|
fyta = FytaConnector(
|
||||||
config_entry.data[CONF_USERNAME], config_entry.data[CONF_PASSWORD]
|
config_entry.data[CONF_USERNAME], config_entry.data[CONF_PASSWORD]
|
||||||
)
|
)
|
||||||
@ -82,9 +82,9 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
|
|||||||
new[CONF_ACCESS_TOKEN] = credentials[CONF_ACCESS_TOKEN]
|
new[CONF_ACCESS_TOKEN] = credentials[CONF_ACCESS_TOKEN]
|
||||||
new[CONF_EXPIRATION] = credentials[CONF_EXPIRATION].isoformat()
|
new[CONF_EXPIRATION] = credentials[CONF_EXPIRATION].isoformat()
|
||||||
|
|
||||||
hass.config_entries.async_update_entry(
|
hass.config_entries.async_update_entry(
|
||||||
config_entry, data=new, minor_version=2, version=1
|
config_entry, data=new, minor_version=2, version=1
|
||||||
)
|
)
|
||||||
|
|
||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
"Migration to version %s.%s successful",
|
"Migration to version %s.%s successful",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user