Public Member Functions | |
| None | __init__ (self, HomeAssistant hass) |
| None | async_clear_area_id (self, str area_id) |
| None | async_clear_category_id (self, str scope, str category_id) |
| None | async_clear_config_entry (self, str config_entry_id) |
| None | async_clear_label_id (self, str label_id) |
| list[str] | async_device_ids (self) |
| None | async_device_modified (self, Event[EventDeviceRegistryUpdatedData] event) |
| str | async_generate_entity_id (self, str domain, str suggested_object_id, Container[str]|None known_object_ids=None) |
| RegistryEntry|None | async_get (self, str entity_id_or_uuid) |
| str|None | async_get_entity_id (self, str domain, str platform, str unique_id) |
| RegistryEntry | async_get_or_create (self, str domain, str platform, str unique_id, *Container[str]|None known_object_ids=None, str|None suggested_object_id=None, RegistryEntryDisabler|None disabled_by=None, RegistryEntryHider|None hidden_by=None, Callable[[], EntityOptionsType|None]|None get_initial_options=None, Mapping[str, Any]|None|UndefinedType capabilities=UNDEFINED, ConfigEntry|None|UndefinedType config_entry=UNDEFINED, str|None|UndefinedType device_id=UNDEFINED, EntityCategory|UndefinedType|None entity_category=UNDEFINED, bool|UndefinedType has_entity_name=UNDEFINED, str|None|UndefinedType original_device_class=UNDEFINED, str|None|UndefinedType original_icon=UNDEFINED, str|None|UndefinedType original_name=UNDEFINED, int|None|UndefinedType supported_features=UNDEFINED, str|None|UndefinedType translation_key=UNDEFINED, str|None|UndefinedType unit_of_measurement=UNDEFINED) |
| bool | async_is_registered (self, str entity_id) |
| None | async_load (self) |
| None | async_purge_expired_orphaned_entities (self) |
| None | async_remove (self, str entity_id) |
| RegistryEntry | async_update_entity (self, str entity_id, *set[str]|UndefinedType aliases=UNDEFINED, str|None|UndefinedType area_id=UNDEFINED, dict[str, str]|UndefinedType categories=UNDEFINED, Mapping[str, Any]|None|UndefinedType capabilities=UNDEFINED, str|None|UndefinedType config_entry_id=UNDEFINED, str|None|UndefinedType device_class=UNDEFINED, str|None|UndefinedType device_id=UNDEFINED, RegistryEntryDisabler|None|UndefinedType disabled_by=UNDEFINED, EntityCategory|None|UndefinedType entity_category=UNDEFINED, RegistryEntryHider|None|UndefinedType hidden_by=UNDEFINED, str|None|UndefinedType icon=UNDEFINED, bool|UndefinedType has_entity_name=UNDEFINED, set[str]|UndefinedType labels=UNDEFINED, str|None|UndefinedType name=UNDEFINED, str|UndefinedType new_entity_id=UNDEFINED, str|UndefinedType new_unique_id=UNDEFINED, str|None|UndefinedType original_device_class=UNDEFINED, str|None|UndefinedType original_icon=UNDEFINED, str|None|UndefinedType original_name=UNDEFINED, int|UndefinedType supported_features=UNDEFINED, str|None|UndefinedType translation_key=UNDEFINED, str|None|UndefinedType unit_of_measurement=UNDEFINED) |
| RegistryEntry | async_update_entity_options (self, str entity_id, str domain, Mapping[str, Any]|None options) |
| RegistryEntry | async_update_entity_platform (self, str entity_id, str new_platform, *str|UndefinedType new_config_entry_id=UNDEFINED, str|UndefinedType new_unique_id=UNDEFINED, str|None|UndefinedType new_device_id=UNDEFINED) |
Public Attributes | |
| deleted_entities | |
| entities | |
| hass | |
Private Member Functions | |
| RegistryEntry | _async_update_entity (self, str entity_id, *set[str]|UndefinedType aliases=UNDEFINED, str|None|UndefinedType area_id=UNDEFINED, dict[str, str]|UndefinedType categories=UNDEFINED, Mapping[str, Any]|None|UndefinedType capabilities=UNDEFINED, str|None|UndefinedType config_entry_id=UNDEFINED, str|None|UndefinedType device_class=UNDEFINED, str|None|UndefinedType device_id=UNDEFINED, RegistryEntryDisabler|None|UndefinedType disabled_by=UNDEFINED, EntityCategory|None|UndefinedType entity_category=UNDEFINED, RegistryEntryHider|None|UndefinedType hidden_by=UNDEFINED, str|None|UndefinedType icon=UNDEFINED, bool|UndefinedType has_entity_name=UNDEFINED, set[str]|UndefinedType labels=UNDEFINED, str|None|UndefinedType name=UNDEFINED, str|UndefinedType new_entity_id=UNDEFINED, str|UndefinedType new_unique_id=UNDEFINED, EntityOptionsType|UndefinedType options=UNDEFINED, str|None|UndefinedType original_device_class=UNDEFINED, str|None|UndefinedType original_icon=UNDEFINED, str|None|UndefinedType original_name=UNDEFINED, str|None|UndefinedType platform=UNDEFINED, int|UndefinedType supported_features=UNDEFINED, str|None|UndefinedType translation_key=UNDEFINED, str|None|UndefinedType unit_of_measurement=UNDEFINED) |
| dict[str, Any] | _data_to_save (self) |
| bool | _entity_id_available (self, str entity_id, Container[str]|None known_object_ids) |
Private Attributes | |
| _entities_data | |
| _store | |
Class to hold a registry of entities.
Definition at line 700 of file entity_registry.py.
| None homeassistant.helpers.entity_registry.EntityRegistry.__init__ | ( | self, | |
| HomeAssistant | hass | ||
| ) |
Initialize the registry.
Definition at line 707 of file entity_registry.py.
|
private |
Private facing update properties method.
Definition at line 1024 of file entity_registry.py.
|
private |
Return data of entity registry to store in a file.
Definition at line 1361 of file entity_registry.py.
|
private |
Return True if the entity_id is available. An entity_id is available if: - It's not registered - It's not known by the entity component adding the entity - It's not in the state machine Note that an entity_id which belongs to a deleted entity is considered available.
Definition at line 750 of file entity_registry.py.
| None homeassistant.helpers.entity_registry.EntityRegistry.async_clear_area_id | ( | self, | |
| str | area_id | ||
| ) |
Clear area id from registry entries.
Definition at line 1422 of file entity_registry.py.
| None homeassistant.helpers.entity_registry.EntityRegistry.async_clear_category_id | ( | self, | |
| str | scope, | ||
| str | category_id | ||
| ) |
Clear category id from registry entries.
Definition at line 1371 of file entity_registry.py.
| None homeassistant.helpers.entity_registry.EntityRegistry.async_clear_config_entry | ( | self, | |
| str | config_entry_id | ||
| ) |
Clear config entry from registry entries.
Definition at line 1388 of file entity_registry.py.
| None homeassistant.helpers.entity_registry.EntityRegistry.async_clear_label_id | ( | self, | |
| str | label_id | ||
| ) |
Clear label from registry entries.
Definition at line 1382 of file entity_registry.py.
| list[str] homeassistant.helpers.entity_registry.EntityRegistry.async_device_ids | ( | self | ) |
Return known device ids.
Definition at line 746 of file entity_registry.py.
| None homeassistant.helpers.entity_registry.EntityRegistry.async_device_modified | ( | self, | |
| Event[EventDeviceRegistryUpdatedData] | event | ||
| ) |
Handle the removal or update of a device. Remove entities from the registry that are associated to a device when the device is removed. Disable entities in the registry that are associated to a device when the device is disabled.
Definition at line 957 of file entity_registry.py.
| str homeassistant.helpers.entity_registry.EntityRegistry.async_generate_entity_id | ( | self, | |
| str | domain, | ||
| str | suggested_object_id, | ||
| Container[str] | None | known_object_ids = None |
||
| ) |
Generate an entity ID that does not conflict. Conflicts checked against registered and currently existing entities.
Definition at line 773 of file entity_registry.py.
| RegistryEntry | None homeassistant.helpers.entity_registry.EntityRegistry.async_get | ( | self, | |
| str | entity_id_or_uuid | ||
| ) |
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__.
Definition at line 728 of file entity_registry.py.
| str | None homeassistant.helpers.entity_registry.EntityRegistry.async_get_entity_id | ( | self, | |
| str | domain, | ||
| str | platform, | ||
| str | unique_id | ||
| ) |
Check if an entity_id is currently registered.
Definition at line 739 of file entity_registry.py.
| RegistryEntry homeassistant.helpers.entity_registry.EntityRegistry.async_get_or_create | ( | self, | |
| str | domain, | ||
| str | platform, | ||
| str | unique_id, | ||
| *Container[str] | None | known_object_ids = None, |
||
| str | None | suggested_object_id = None, |
||
| RegistryEntryDisabler | None | disabled_by = None, |
||
| RegistryEntryHider | None | hidden_by = None, |
||
| Callable[[], EntityOptionsType | None] | None | get_initial_options = None, |
||
| Mapping[str, Any] | None | UndefinedType | capabilities = UNDEFINED, |
||
| ConfigEntry | None | UndefinedType | config_entry = UNDEFINED, |
||
| str | None | UndefinedType | device_id = UNDEFINED, |
||
| EntityCategory | UndefinedType | None | entity_category = UNDEFINED, |
||
| bool | UndefinedType | has_entity_name = UNDEFINED, |
||
| str | None | UndefinedType | original_device_class = UNDEFINED, |
||
| str | None | UndefinedType | original_icon = UNDEFINED, |
||
| str | None | UndefinedType | original_name = UNDEFINED, |
||
| int | None | UndefinedType | supported_features = UNDEFINED, |
||
| str | None | UndefinedType | translation_key = UNDEFINED, |
||
| str | None | UndefinedType | unit_of_measurement = UNDEFINED |
||
| ) |
Get entity. Create if it doesn't exist.
Definition at line 803 of file entity_registry.py.
| bool homeassistant.helpers.entity_registry.EntityRegistry.async_is_registered | ( | self, | |
| str | entity_id | ||
| ) |
Check if an entity_id is currently registered.
Definition at line 723 of file entity_registry.py.
| None homeassistant.helpers.entity_registry.EntityRegistry.async_load | ( | self | ) |
Load the entity registry.
Definition at line 1256 of file entity_registry.py.
| None homeassistant.helpers.entity_registry.EntityRegistry.async_purge_expired_orphaned_entities | ( | self | ) |
Purge expired orphaned entities from the registry. We need to purge these periodically to avoid the database growing without bound.
Definition at line 1406 of file entity_registry.py.
| None homeassistant.helpers.entity_registry.EntityRegistry.async_remove | ( | self, | |
| str | entity_id | ||
| ) |
Remove an entity from registry.
Definition at line 931 of file entity_registry.py.
| RegistryEntry homeassistant.helpers.entity_registry.EntityRegistry.async_update_entity | ( | self, | |
| str | entity_id, | ||
| *set[str] | UndefinedType | aliases = UNDEFINED, |
||
| str | None | UndefinedType | area_id = UNDEFINED, |
||
| dict[str, str] | UndefinedType | categories = UNDEFINED, |
||
| Mapping[str, Any] | None | UndefinedType | capabilities = UNDEFINED, |
||
| str | None | UndefinedType | config_entry_id = UNDEFINED, |
||
| str | None | UndefinedType | device_class = UNDEFINED, |
||
| str | None | UndefinedType | device_id = UNDEFINED, |
||
| RegistryEntryDisabler | None | UndefinedType | disabled_by = UNDEFINED, |
||
| EntityCategory | None | UndefinedType | entity_category = UNDEFINED, |
||
| RegistryEntryHider | None | UndefinedType | hidden_by = UNDEFINED, |
||
| str | None | UndefinedType | icon = UNDEFINED, |
||
| bool | UndefinedType | has_entity_name = UNDEFINED, |
||
| set[str] | UndefinedType | labels = UNDEFINED, |
||
| str | None | UndefinedType | name = UNDEFINED, |
||
| str | UndefinedType | new_entity_id = UNDEFINED, |
||
| str | UndefinedType | new_unique_id = UNDEFINED, |
||
| str | None | UndefinedType | original_device_class = UNDEFINED, |
||
| str | None | UndefinedType | original_icon = UNDEFINED, |
||
| str | None | UndefinedType | original_name = UNDEFINED, |
||
| int | UndefinedType | supported_features = UNDEFINED, |
||
| str | None | UndefinedType | translation_key = UNDEFINED, |
||
| str | None | UndefinedType | unit_of_measurement = UNDEFINED |
||
| ) |
Update properties of an entity.
Definition at line 1151 of file entity_registry.py.
| RegistryEntry homeassistant.helpers.entity_registry.EntityRegistry.async_update_entity_options | ( | self, | |
| str | entity_id, | ||
| str | domain, | ||
| Mapping[str, Any] | None | options | ||
| ) |
Update entity options for a domain. If the domain options are set to None, they will be removed.
Definition at line 1241 of file entity_registry.py.
| RegistryEntry homeassistant.helpers.entity_registry.EntityRegistry.async_update_entity_platform | ( | self, | |
| str | entity_id, | ||
| str | new_platform, | ||
| *str | UndefinedType | new_config_entry_id = UNDEFINED, |
||
| str | UndefinedType | new_unique_id = UNDEFINED, |
||
| str | None | UndefinedType | new_device_id = UNDEFINED |
||
| ) |
Update entity platform. This should only be used when an entity needs to be migrated between integrations.
Definition at line 1206 of file entity_registry.py.
|
private |
Definition at line 1358 of file entity_registry.py.
|
private |
Definition at line 710 of file entity_registry.py.
| homeassistant.helpers.entity_registry.EntityRegistry.deleted_entities |
Definition at line 1356 of file entity_registry.py.
| homeassistant.helpers.entity_registry.EntityRegistry.entities |
Definition at line 1357 of file entity_registry.py.
| homeassistant.helpers.entity_registry.EntityRegistry.hass |
Definition at line 709 of file entity_registry.py.