mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
parent
36b722960a
commit
23e7638687
@ -37,14 +37,14 @@ async def async_setup_entry(hass: HomeAssistant, entry: HeosConfigEntry) -> bool
|
|||||||
for device in device_registry.devices.get_devices_for_config_entry_id(
|
for device in device_registry.devices.get_devices_for_config_entry_id(
|
||||||
entry.entry_id
|
entry.entry_id
|
||||||
):
|
):
|
||||||
for domain, player_id in device.identifiers:
|
for ident in device.identifiers:
|
||||||
if domain == DOMAIN and not isinstance(player_id, str):
|
if ident[0] != DOMAIN or isinstance(ident[1], str):
|
||||||
|
continue
|
||||||
|
|
||||||
|
player_id = int(ident[1]) # type: ignore[unreachable]
|
||||||
|
|
||||||
# Create set of identifiers excluding this integration
|
# Create set of identifiers excluding this integration
|
||||||
identifiers = { # type: ignore[unreachable]
|
identifiers = {ident for ident in device.identifiers if ident[0] != DOMAIN}
|
||||||
(domain, identifier)
|
|
||||||
for domain, identifier in device.identifiers
|
|
||||||
if domain != DOMAIN
|
|
||||||
}
|
|
||||||
migrated_identifiers = {(DOMAIN, str(player_id))}
|
migrated_identifiers = {(DOMAIN, str(player_id))}
|
||||||
# Add migrated if not already present in another device, which occurs if the user downgraded and then upgraded
|
# Add migrated if not already present in another device, which occurs if the user downgraded and then upgraded
|
||||||
if not device_registry.async_get_device(migrated_identifiers):
|
if not device_registry.async_get_device(migrated_identifiers):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user