Track entity sources (#37258)

Co-authored-by: David Mulcahey <david.mulcahey@me.com>
This commit is contained in:
Paulus SchoutsenandDavid Mulcahey authored and GitHub committed 2020-08-19 14:57:38 +02:00
1 parent 24a16ff8fe
commit 3dc79aa60a
15 files changed
+379 -154

No files matched your search

+2 -8
View File
@@ -164,15 +164,14 @@ class DeconzGateway:
else:
deconz_ids += [group.deconz_id for group in groups]
if deconz_ids:
async_dispatcher_send(self.hass, self.signal_remove_entity, deconz_ids)
entity_registry = await self.hass.helpers.entity_registry.async_get_registry()
for entity_id, deconz_id in self.deconz_ids.items():
if deconz_id in deconz_ids and entity_registry.async_is_registered(
entity_id
):
# Removing an entity from the entity registry will also remove them
# from Home Assistant
entity_registry.async_remove(entity_id)
@property
@@ -197,11 +196,6 @@ class DeconzGateway:
}
return new_device[device_type]
@property
def signal_remove_entity(self) -> str:
"""Gateway specific event to signal removal of entity."""
return f"deconz-remove-{self.bridgeid}"
@callback
def async_add_device_callback(self, device_type, device) -> None:
"""Handle event of new device creation in deCONZ."""