mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Adjust migrate_entry in axis (#63779)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
66809464e4
commit
82f91bcd5f
@ -39,7 +39,7 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
|
||||
return await device.async_reset()
|
||||
|
||||
|
||||
async def async_migrate_entry(hass, config_entry):
|
||||
async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
|
||||
"""Migrate old entry."""
|
||||
_LOGGER.debug("Migrating from version %s", config_entry.version)
|
||||
|
||||
@ -53,8 +53,7 @@ async def async_migrate_entry(hass, config_entry):
|
||||
config_entry.version = 2
|
||||
|
||||
# Normalise MAC address of device which also affects entity unique IDs
|
||||
if config_entry.version == 2:
|
||||
old_unique_id = config_entry.unique_id
|
||||
if config_entry.version == 2 and (old_unique_id := config_entry.unique_id):
|
||||
new_unique_id = format_mac(old_unique_id)
|
||||
|
||||
@callback
|
||||
|
Loading…
x
Reference in New Issue
Block a user