mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Prevent errors during cleaning of connections/identifiers in device registry (#144558)
This commit is contained in:
parent
9757009d8f
commit
93fd82d1fa
@ -575,9 +575,11 @@ class DeviceRegistryItems[_EntryTypeT: (DeviceEntry, DeletedDeviceEntry)](
|
||||
"""Unindex an entry."""
|
||||
old_entry = self.data[key]
|
||||
for connection in old_entry.connections:
|
||||
del self._connections[connection]
|
||||
if connection in self._connections:
|
||||
del self._connections[connection]
|
||||
for identifier in old_entry.identifiers:
|
||||
del self._identifiers[identifier]
|
||||
if identifier in self._identifiers:
|
||||
del self._identifiers[identifier]
|
||||
|
||||
def get_entry(
|
||||
self,
|
||||
|
Loading…
x
Reference in New Issue
Block a user