Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.homeassistant.exposed_entities.ExposedEntities Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass)
 
dict[str, Mapping[str, Any]] async_get_assistant_settings (self, str assistant)
 
dict[str, Mapping[str, Any]] async_get_entity_settings (self, str entity_id)
 
bool async_get_expose_new_entities (self, str assistant)
 
None async_initialize (self)
 
CALLBACK_TYPE async_listen_entity_updates (self, str assistant, Callable[[], None] listener)
 
None async_set_assistant_option (self, str assistant, str entity_id, str key, Any value)
 
None async_set_expose_new_entities (self, str assistant, bool expose_new)
 
bool async_should_expose (self, str assistant, str entity_id)
 

Public Attributes

 entities
 

Private Member Functions

SerializedExposedEntities|None _async_load_data (self)
 
None _async_schedule_save (self)
 
None _async_set_legacy_assistant_option (self, str assistant, str entity_id, str key, Any value)
 
bool _async_should_expose_legacy_entity (self, str assistant, str entity_id)
 
SerializedExposedEntities _data_to_save (self)
 
bool _is_default_exposed (self, str entity_id, er.RegistryEntry|None registry_entry)
 
ExposedEntity _new_exposed_entity (self, str assistant, str key, Any value)
 
ExposedEntity _update_exposed_entity (self, str assistant, str entity_id, str key, Any value)
 

Private Attributes

 _assistants
 
 _hass
 

Detailed Description

Control assistant settings.

Settings for entities without a unique_id are stored in the store.
Settings for entities with a unique_id are stored in the entity registry.

Definition at line 103 of file exposed_entities.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.homeassistant.exposed_entities.ExposedEntities.__init__ (   self,
HomeAssistant  hass 
)
Initialize.

Definition at line 113 of file exposed_entities.py.

Member Function Documentation

◆ _async_load_data()

SerializedExposedEntities | None homeassistant.components.homeassistant.exposed_entities.ExposedEntities._async_load_data (   self)
private
Load from the store.

Definition at line 355 of file exposed_entities.py.

◆ _async_schedule_save()

None homeassistant.components.homeassistant.exposed_entities.ExposedEntities._async_schedule_save (   self)
private
Schedule saving the preferences.

Definition at line 376 of file exposed_entities.py.

◆ _async_set_legacy_assistant_option()

None homeassistant.components.homeassistant.exposed_entities.ExposedEntities._async_set_legacy_assistant_option (   self,
str  assistant,
str  entity_id,
str  key,
Any   value 
)
private
Set an option for an assistant.

Notify listeners if expose flag was changed.

Definition at line 169 of file exposed_entities.py.

◆ _async_should_expose_legacy_entity()

bool homeassistant.components.homeassistant.exposed_entities.ExposedEntities._async_should_expose_legacy_entity (   self,
str  assistant,
str   entity_id 
)
private
Return True if an entity should be exposed to an assistant.

Definition at line 276 of file exposed_entities.py.

◆ _data_to_save()

SerializedExposedEntities homeassistant.components.homeassistant.exposed_entities.ExposedEntities._data_to_save (   self)
private
Return JSON-compatible date for storing to file.

Definition at line 381 of file exposed_entities.py.

◆ _is_default_exposed()

bool homeassistant.components.homeassistant.exposed_entities.ExposedEntities._is_default_exposed (   self,
str  entity_id,
er.RegistryEntry | None   registry_entry 
)
private
Return True if an entity is exposed by default.

Definition at line 307 of file exposed_entities.py.

◆ _new_exposed_entity()

ExposedEntity homeassistant.components.homeassistant.exposed_entities.ExposedEntities._new_exposed_entity (   self,
str  assistant,
str  key,
Any   value 
)
private
Create a new exposed entity.

Definition at line 347 of file exposed_entities.py.

◆ _update_exposed_entity()

ExposedEntity homeassistant.components.homeassistant.exposed_entities.ExposedEntities._update_exposed_entity (   self,
str  assistant,
str  entity_id,
str  key,
Any   value 
)
private
Update an exposed entity.

Definition at line 337 of file exposed_entities.py.

◆ async_get_assistant_settings()

dict[str, Mapping[str, Any]] homeassistant.components.homeassistant.exposed_entities.ExposedEntities.async_get_assistant_settings (   self,
str   assistant 
)
Get all entity expose settings for an assistant.

Definition at line 208 of file exposed_entities.py.

◆ async_get_entity_settings()

dict[str, Mapping[str, Any]] homeassistant.components.homeassistant.exposed_entities.ExposedEntities.async_get_entity_settings (   self,
str  entity_id 
)
Get assistant expose settings for an entity.

Definition at line 227 of file exposed_entities.py.

◆ async_get_expose_new_entities()

bool homeassistant.components.homeassistant.exposed_entities.ExposedEntities.async_get_expose_new_entities (   self,
str  assistant 
)
Check if new entities are exposed to an assistant.

Definition at line 195 of file exposed_entities.py.

◆ async_initialize()

None homeassistant.components.homeassistant.exposed_entities.ExposedEntities.async_initialize (   self)
Finish initializing.

Definition at line 121 of file exposed_entities.py.

◆ async_listen_entity_updates()

CALLBACK_TYPE homeassistant.components.homeassistant.exposed_entities.ExposedEntities.async_listen_entity_updates (   self,
str  assistant,
Callable[[], None]   listener 
)
Listen for updates to entity expose settings.

Definition at line 130 of file exposed_entities.py.

◆ async_set_assistant_option()

None homeassistant.components.homeassistant.exposed_entities.ExposedEntities.async_set_assistant_option (   self,
str  assistant,
str  entity_id,
str  key,
Any   value 
)
Set an option for an assistant.

Notify listeners if expose flag was changed.

Definition at line 144 of file exposed_entities.py.

◆ async_set_expose_new_entities()

None homeassistant.components.homeassistant.exposed_entities.ExposedEntities.async_set_expose_new_entities (   self,
str  assistant,
bool  expose_new 
)
Enable an assistant to expose new entities.

Definition at line 202 of file exposed_entities.py.

◆ async_should_expose()

bool homeassistant.components.homeassistant.exposed_entities.ExposedEntities.async_should_expose (   self,
str  assistant,
str  entity_id 
)
Return True if an entity should be exposed to an assistant.

Definition at line 247 of file exposed_entities.py.

Member Data Documentation

◆ _assistants

homeassistant.components.homeassistant.exposed_entities.ExposedEntities._assistants
private

Definition at line 370 of file exposed_entities.py.

◆ _hass

homeassistant.components.homeassistant.exposed_entities.ExposedEntities._hass
private

Definition at line 115 of file exposed_entities.py.

◆ entities

homeassistant.components.homeassistant.exposed_entities.ExposedEntities.entities

Definition at line 371 of file exposed_entities.py.


The documentation for this class was generated from the following file: