1 """Helper functions for Philips Hue."""
5 from ..const
import DOMAIN
9 """Get items that are removed from api."""
12 for item_id
in current:
13 if item_id
in api_ids:
17 entity = current[item_id]
18 removed_items.append(item_id)
19 await entity.async_remove(force_remove=
True)
20 ent_registry = er.async_get(bridge.hass)
21 if entity.entity_id
in ent_registry.entities:
22 ent_registry.async_remove(entity.entity_id)
23 dev_registry = dr.async_get(bridge.hass)
24 device = dev_registry.async_get_device(identifiers={(DOMAIN, entity.device_id)})
25 if device
is not None:
26 dev_registry.async_update_device(
27 device.id, remove_config_entry_id=bridge.config_entry.entry_id
30 for item_id
in removed_items:
def remove_devices(bridge, api_ids, current)