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