Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.homeassistant.exposed_entities Namespace Reference

Classes

class  AssistantPreferences
 
class  ExposedEntities
 
class  ExposedEntity
 
class  SerializedExposedEntities
 

Functions

None async_expose_entity (HomeAssistant hass, str assistant, str entity_id, bool should_expose)
 
dict[str, Mapping[str, Any]] async_get_assistant_settings (HomeAssistant hass, str assistant)
 
dict[str, Mapping[str, Any]] async_get_entity_settings (HomeAssistant hass, str entity_id)
 
CALLBACK_TYPE async_listen_entity_updates (HomeAssistant hass, str assistant, Callable[[], None] listener)
 
None async_set_assistant_option (HomeAssistant hass, str assistant, str entity_id, str option, Any value)
 
bool async_should_expose (HomeAssistant hass, str assistant, str entity_id)
 
None ws_expose_entity (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg)
 
None ws_expose_new_entities_get (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg)
 
None ws_expose_new_entities_set (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg)
 
None ws_list_exposed_entities (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg)
 

Variables

dictionary DEFAULT_EXPOSED_ASSISTANT
 
dictionary DEFAULT_EXPOSED_BINARY_SENSOR_DEVICE_CLASSES
 
dictionary DEFAULT_EXPOSED_DOMAINS
 
dictionary DEFAULT_EXPOSED_SENSOR_DEVICE_CLASSES
 
tuple KNOWN_ASSISTANTS = ("cloud.alexa", "cloud.google_assistant", "conversation")
 
int SAVE_DELAY = 10
 
string STORAGE_KEY = f"{DOMAIN}.exposed_entities"
 
int STORAGE_VERSION = 1
 

Detailed Description

Control which entities are exposed to voice assistants.

Function Documentation

◆ async_expose_entity()

None homeassistant.components.homeassistant.exposed_entities.async_expose_entity ( HomeAssistant  hass,
str  assistant,
str  entity_id,
bool  should_expose 
)
Get assistant expose settings for an entity.

Definition at line 518 of file exposed_entities.py.

◆ async_get_assistant_settings()

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

Definition at line 500 of file exposed_entities.py.

◆ async_get_entity_settings()

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

Definition at line 509 of file exposed_entities.py.

◆ async_listen_entity_updates()

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

Definition at line 491 of file exposed_entities.py.

◆ async_set_assistant_option()

None homeassistant.components.homeassistant.exposed_entities.async_set_assistant_option ( HomeAssistant  hass,
str  assistant,
str  entity_id,
str  option,
Any   value 
)
Set an option for an assistant.

Notify listeners if expose flag was changed.

Definition at line 538 of file exposed_entities.py.

◆ async_should_expose()

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

Definition at line 531 of file exposed_entities.py.

◆ ws_expose_entity()

None homeassistant.components.homeassistant.exposed_entities.ws_expose_entity ( HomeAssistant  hass,
websocket_api.ActiveConnection  connection,
dict[str, Any]   msg 
)
Expose an entity to an assistant.

Definition at line 405 of file exposed_entities.py.

◆ ws_expose_new_entities_get()

None homeassistant.components.homeassistant.exposed_entities.ws_expose_new_entities_get ( HomeAssistant  hass,
websocket_api.ActiveConnection  connection,
dict[str, Any]   msg 
)
Check if new entities are exposed to an assistant.

Definition at line 463 of file exposed_entities.py.

◆ ws_expose_new_entities_set()

None homeassistant.components.homeassistant.exposed_entities.ws_expose_new_entities_set ( HomeAssistant  hass,
websocket_api.ActiveConnection  connection,
dict[str, Any]   msg 
)
Expose new entities to an assistant.

Definition at line 481 of file exposed_entities.py.

◆ ws_list_exposed_entities()

None homeassistant.components.homeassistant.exposed_entities.ws_list_exposed_entities ( HomeAssistant  hass,
websocket_api.ActiveConnection  connection,
dict[str, Any]   msg 
)
Expose an entity to an assistant.

Definition at line 437 of file exposed_entities.py.

Variable Documentation

◆ DEFAULT_EXPOSED_ASSISTANT

dictionary homeassistant.components.homeassistant.exposed_entities.DEFAULT_EXPOSED_ASSISTANT
Initial value:
1 = {
2  "conversation": True,
3 }

Definition at line 67 of file exposed_entities.py.

◆ DEFAULT_EXPOSED_BINARY_SENSOR_DEVICE_CLASSES

dictionary homeassistant.components.homeassistant.exposed_entities.DEFAULT_EXPOSED_BINARY_SENSOR_DEVICE_CLASSES
Initial value:
1 = {
2  BinarySensorDeviceClass.DOOR,
3  BinarySensorDeviceClass.GARAGE_DOOR,
4  BinarySensorDeviceClass.LOCK,
5  BinarySensorDeviceClass.MOTION,
6  BinarySensorDeviceClass.OPENING,
7  BinarySensorDeviceClass.PRESENCE,
8  BinarySensorDeviceClass.WINDOW,
9 }

Definition at line 46 of file exposed_entities.py.

◆ DEFAULT_EXPOSED_DOMAINS

dictionary homeassistant.components.homeassistant.exposed_entities.DEFAULT_EXPOSED_DOMAINS
Initial value:
1 = {
2  "climate",
3  "cover",
4  "fan",
5  "humidifier",
6  "light",
7  "media_player",
8  "scene",
9  "switch",
10  "todo",
11  "vacuum",
12  "water_heater",
13 }

Definition at line 32 of file exposed_entities.py.

◆ DEFAULT_EXPOSED_SENSOR_DEVICE_CLASSES

dictionary homeassistant.components.homeassistant.exposed_entities.DEFAULT_EXPOSED_SENSOR_DEVICE_CLASSES
Initial value:
1 = {
2  SensorDeviceClass.AQI,
3  SensorDeviceClass.CO,
4  SensorDeviceClass.CO2,
5  SensorDeviceClass.HUMIDITY,
6  SensorDeviceClass.PM10,
7  SensorDeviceClass.PM25,
8  SensorDeviceClass.TEMPERATURE,
9  SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
10 }

Definition at line 56 of file exposed_entities.py.

◆ KNOWN_ASSISTANTS

tuple homeassistant.components.homeassistant.exposed_entities.KNOWN_ASSISTANTS = ("cloud.alexa", "cloud.google_assistant", "conversation")

Definition at line 25 of file exposed_entities.py.

◆ SAVE_DELAY

int homeassistant.components.homeassistant.exposed_entities.SAVE_DELAY = 10

Definition at line 30 of file exposed_entities.py.

◆ STORAGE_KEY

string homeassistant.components.homeassistant.exposed_entities.STORAGE_KEY = f"{DOMAIN}.exposed_entities"

Definition at line 27 of file exposed_entities.py.

◆ STORAGE_VERSION

int homeassistant.components.homeassistant.exposed_entities.STORAGE_VERSION = 1

Definition at line 28 of file exposed_entities.py.