mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Allow hiding and unhiding group members (#68192)
This commit is contained in:
@@ -961,6 +961,22 @@ def async_validate_entity_id(registry: EntityRegistry, entity_id_or_uuid: str) -
|
||||
return entry.entity_id
|
||||
|
||||
|
||||
@callback
|
||||
def async_resolve_entity_id(
|
||||
registry: EntityRegistry, entity_id_or_uuid: str
|
||||
) -> str | None:
|
||||
"""Validate and resolve an entity id or UUID to an entity id.
|
||||
|
||||
Returns None if the entity or UUID is invalid, or if the UUID is not
|
||||
associated with an entity registry item.
|
||||
"""
|
||||
if valid_entity_id(entity_id_or_uuid):
|
||||
return entity_id_or_uuid
|
||||
if (entry := registry.entities.get_entry(entity_id_or_uuid)) is None:
|
||||
return None
|
||||
return entry.entity_id
|
||||
|
||||
|
||||
@callback
|
||||
def async_validate_entity_ids(
|
||||
registry: EntityRegistry, entity_ids_or_uuids: list[str]
|
||||
|
||||
Reference in New Issue
Block a user