mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Verify config entry id on Daikin device removal (#101507)
This commit is contained in:
parent
f3864e6e2f
commit
1a5ad23a10
@ -168,9 +168,12 @@ async def async_migrate_unique_id(
|
|||||||
ent_reg, duplicate.id, True
|
ent_reg, duplicate.id, True
|
||||||
)
|
)
|
||||||
for entity in duplicate_entities:
|
for entity in duplicate_entities:
|
||||||
ent_reg.async_remove(entity.entity_id)
|
if entity.config_entry_id == config_entry.entry_id:
|
||||||
|
ent_reg.async_remove(entity.entity_id)
|
||||||
|
|
||||||
dev_reg.async_remove_device(duplicate.id)
|
dev_reg.async_update_device(
|
||||||
|
duplicate.id, remove_config_entry_id=config_entry.entry_id
|
||||||
|
)
|
||||||
|
|
||||||
# Migrate devices
|
# Migrate devices
|
||||||
for device_entry in dr.async_entries_for_config_entry(
|
for device_entry in dr.async_entries_for_config_entry(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user