Update fyta async_migrate_entry (#116433)

Update async_migrate_entry __init__.py
This commit is contained in:
dontinelli 2024-04-30 10:02:31 +02:00 committed by GitHub
parent fd8287bc15
commit 258e20bfc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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