mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Fix dict changing size during iteration in deconz (#111523)
This commit is contained in:
parent
32dc8d9fcb
commit
30094acec7
@ -301,7 +301,10 @@ class DeconzGateway:
|
|||||||
|
|
||||||
entity_registry = er.async_get(self.hass)
|
entity_registry = er.async_get(self.hass)
|
||||||
|
|
||||||
for entity_id, deconz_id in self.deconz_ids.items():
|
# Copy the ids since calling async_remove will modify the dict
|
||||||
|
# and will cause a runtime error because the dict size changes
|
||||||
|
# during iteration
|
||||||
|
for entity_id, deconz_id in self.deconz_ids.copy().items():
|
||||||
if deconz_id in deconz_ids and entity_registry.async_is_registered(
|
if deconz_id in deconz_ids and entity_registry.async_is_registered(
|
||||||
entity_id
|
entity_id
|
||||||
):
|
):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user