mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Avoid linear search to clear a config entry in the device registry (#114802)
This commit is contained in:
parent
e845d12733
commit
a9d43db315
@ -1007,7 +1007,7 @@ class DeviceRegistry(BaseRegistry):
|
|||||||
def async_clear_config_entry(self, config_entry_id: str) -> None:
|
def async_clear_config_entry(self, config_entry_id: str) -> None:
|
||||||
"""Clear config entry from registry entries."""
|
"""Clear config entry from registry entries."""
|
||||||
now_time = time.time()
|
now_time = time.time()
|
||||||
for device in list(self.devices.values()):
|
for device in self.devices.get_devices_for_config_entry_id(config_entry_id):
|
||||||
self.async_update_device(device.id, remove_config_entry_id=config_entry_id)
|
self.async_update_device(device.id, remove_config_entry_id=config_entry_id)
|
||||||
for deleted_device in list(self.deleted_devices.values()):
|
for deleted_device in list(self.deleted_devices.values()):
|
||||||
config_entries = deleted_device.config_entries
|
config_entries = deleted_device.config_entries
|
||||||
|
Loading…
x
Reference in New Issue
Block a user