Add search integration (#30511)
* Add search integration * Add scenes and config entry support * Update comments * Add support for groups * Allow querying config entry * Update manifest * Fix scene tests
This commit is contained in:
parent
d883ee62f8
commit
3348f4f6d1
10 changed files with 581 additions and 3 deletions
|
@ -375,3 +375,15 @@ async def async_get_registry(hass: HomeAssistantType) -> DeviceRegistry:
|
|||
def async_entries_for_area(registry: DeviceRegistry, area_id: str) -> List[DeviceEntry]:
|
||||
"""Return entries that match an area."""
|
||||
return [device for device in registry.devices.values() if device.area_id == area_id]
|
||||
|
||||
|
||||
@callback
|
||||
def async_entries_for_config_entry(
|
||||
registry: DeviceRegistry, config_entry_id: str
|
||||
) -> List[DeviceEntry]:
|
||||
"""Return entries that match a config entry."""
|
||||
return [
|
||||
device
|
||||
for device in registry.devices.values()
|
||||
if config_entry_id in device.config_entries
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue