mirror of
https://github.com/home-assistant/core.git
synced 2025-12-25 05:26:47 +00:00
Teach alarm_control_panel device trigger about entity registry ids (#60977)
* Teach alarm_control_panel device trigger about entity registry ids * Lint code * Address review comment
This commit is contained in:
@@ -470,13 +470,15 @@ class EntityRegistry:
|
||||
return entity_id in self.entities
|
||||
|
||||
@callback
|
||||
def async_get(self, entity_id: str) -> RegistryEntry | None:
|
||||
"""Get EntityEntry for an entity_id.
|
||||
def async_get(self, entity_id_or_uuid: str) -> RegistryEntry | None:
|
||||
"""Get EntityEntry for an entity_id or entity entry id.
|
||||
|
||||
We retrieve the RegistryEntry from the underlying dict to avoid
|
||||
the overhead of the UserDict __getitem__.
|
||||
"""
|
||||
return self._entities_data.get(entity_id)
|
||||
return self._entities_data.get(entity_id_or_uuid) or self.entities.get_entry(
|
||||
entity_id_or_uuid
|
||||
)
|
||||
|
||||
@callback
|
||||
def async_get_entity_id(
|
||||
|
||||
Reference in New Issue
Block a user