mirror of
https://github.com/home-assistant/core.git
synced 2025-12-27 06:28:31 +00:00
Remove via_device links when a device is removed (#60153)
* Remove via_device links when a device is removed * Update test
This commit is contained in:
@@ -501,6 +501,9 @@ class DeviceRegistry:
|
||||
orphaned_timestamp=None,
|
||||
)
|
||||
)
|
||||
for other_device in list(self.devices.values()):
|
||||
if other_device.via_device_id == device_id:
|
||||
self._async_update_device(other_device.id, via_device_id=None)
|
||||
self.hass.bus.async_fire(
|
||||
EVENT_DEVICE_REGISTRY_UPDATED, {"action": "remove", "device_id": device_id}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user