Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.websocket_api.commands Namespace Reference

Functions

bytes _async_get_all_descriptions_json (HomeAssistant hass)
 
list[State_async_get_allowed_states (HomeAssistant hass, ActiveConnection connection)
 
template.Template _cached_template (str template_str, HomeAssistant hass)
 
None _forward_entity_changes (Callable[[str|bytes|dict[str, Any]], None] send_message, set[str]|None entity_ids, Callable[[str], bool]|None entity_filter, User user, bytes message_id_as_bytes, Event[EventStateChangedData] event)
 
None _forward_events_check_permissions (Callable[[bytes|str|dict[str, Any]], None] send_message, User user, bytes message_id_as_bytes, Event event)
 
None _forward_events_unconditional (Callable[[bytes|str|dict[str, Any]], None] send_message, bytes message_id_as_bytes, Event event)
 
None _send_handle_entities_init_response (ActiveConnection connection, bytes message_id_as_bytes, list[bytes] serialized_states)
 
None _send_handle_get_states_response (ActiveConnection connection, int msg_id, list[bytes] serialized_states)
 
dict[str, Any] _serialize_entity_sources (dict[str, entity.EntityInfo] entity_infos)
 
None async_register_commands (HomeAssistant hass, Callable[[HomeAssistant, const .WebSocketCommandHandler], None] async_reg)
 
None handle_call_service (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_entity_source (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_execute_script (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_fire_event (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_get_config (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_get_services (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_get_states (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_integration_descriptions (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_integration_setup_info (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_manifest_get (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_manifest_list (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_ping (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_render_template (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_subscribe_bootstrap_integrations (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_subscribe_entities (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_subscribe_events (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_subscribe_trigger (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_supported_features (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_test_condition (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_unsubscribe_events (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None handle_validate_config (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
dict[str, Any] pong_message (int iden)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ALL_SERVICE_DESCRIPTIONS_JSON_CACHE = "websocket_api_all_service_descriptions_json"
 

Detailed Description

Commands part of Websocket API.

Function Documentation

◆ _async_get_all_descriptions_json()

bytes homeassistant.components.websocket_api.commands._async_get_all_descriptions_json ( HomeAssistant  hass)
private
Return JSON of descriptions (i.e. user documentation) for all service calls.

Definition at line 489 of file commands.py.

◆ _async_get_allowed_states()

list[State] homeassistant.components.websocket_api.commands._async_get_allowed_states ( HomeAssistant  hass,
ActiveConnection   connection 
)
private

Definition at line 313 of file commands.py.

◆ _cached_template()

template.Template homeassistant.components.websocket_api.commands._cached_template ( str  template_str,
HomeAssistant  hass 
)
private
Return a cached template.

Definition at line 583 of file commands.py.

◆ _forward_entity_changes()

None homeassistant.components.websocket_api.commands._forward_entity_changes ( Callable[[str | bytes | dict[str, Any]], None]  send_message,
set[str] | None  entity_ids,
Callable[[str], bool] | None  entity_filter,
User  user,
bytes  message_id_as_bytes,
Event[EventStateChangedData event 
)
private
Forward entity state changed events to websocket.

Definition at line 371 of file commands.py.

◆ _forward_events_check_permissions()

None homeassistant.components.websocket_api.commands._forward_events_check_permissions ( Callable[[bytes | str | dict[str, Any]], None]  send_message,
User  user,
bytes  message_id_as_bytes,
Event  event 
)
private
Forward state changed events to websocket.

Definition at line 109 of file commands.py.

◆ _forward_events_unconditional()

None homeassistant.components.websocket_api.commands._forward_events_unconditional ( Callable[[bytes | str | dict[str, Any]], None]  send_message,
bytes  message_id_as_bytes,
Event  event 
)
private
Forward events to websocket.

Definition at line 129 of file commands.py.

◆ _send_handle_entities_init_response()

None homeassistant.components.websocket_api.commands._send_handle_entities_init_response ( ActiveConnection  connection,
bytes  message_id_as_bytes,
list[bytes]  serialized_states 
)
private
Send handle entities init response.

Definition at line 470 of file commands.py.

◆ _send_handle_get_states_response()

None homeassistant.components.websocket_api.commands._send_handle_get_states_response ( ActiveConnection  connection,
int  msg_id,
list[bytes]   serialized_states 
)
private
Send handle get states response.

Definition at line 359 of file commands.py.

◆ _serialize_entity_sources()

dict[str, Any] homeassistant.components.websocket_api.commands._serialize_entity_sources ( dict[str, entity.EntityInfo]  entity_infos)
private
Prepare a websocket response from a dict of entity sources.

Definition at line 686 of file commands.py.

◆ async_register_commands()

None homeassistant.components.websocket_api.commands.async_register_commands ( HomeAssistant  hass,
Callable[[HomeAssistant, const.WebSocketCommandHandler], None]  async_reg 
)
Register commands.

Definition at line 75 of file commands.py.

◆ handle_call_service()

None homeassistant.components.websocket_api.commands.handle_call_service ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle call service command.

Definition at line 234 of file commands.py.

◆ handle_entity_source()

None homeassistant.components.websocket_api.commands.handle_entity_source ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle entity source command.

Definition at line 698 of file commands.py.

◆ handle_execute_script()

None homeassistant.components.websocket_api.commands.handle_execute_script ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle execute script command.

Definition at line 803 of file commands.py.

◆ handle_fire_event()

None homeassistant.components.websocket_api.commands.handle_fire_event ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle fire event command.

Definition at line 849 of file commands.py.

◆ handle_get_config()

None homeassistant.components.websocket_api.commands.handle_get_config ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle get config command.

Definition at line 516 of file commands.py.

◆ handle_get_services()

None homeassistant.components.websocket_api.commands.handle_get_services ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle get services command.

Definition at line 506 of file commands.py.

◆ handle_get_states()

None homeassistant.components.websocket_api.commands.handle_get_states ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle get states command.

Definition at line 329 of file commands.py.

◆ handle_integration_descriptions()

None homeassistant.components.websocket_api.commands.handle_integration_descriptions ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Get metadata for all brands and integrations.

Definition at line 921 of file commands.py.

◆ handle_integration_setup_info()

None homeassistant.components.websocket_api.commands.handle_integration_setup_info ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle integrations command.

Definition at line 560 of file commands.py.

◆ handle_manifest_get()

None homeassistant.components.websocket_api.commands.handle_manifest_get ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle integrations command.

Definition at line 546 of file commands.py.

◆ handle_manifest_list()

None homeassistant.components.websocket_api.commands.handle_manifest_list ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle integrations command.

Definition at line 527 of file commands.py.

◆ handle_ping()

None homeassistant.components.websocket_api.commands.handle_ping ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle ping command.

Definition at line 575 of file commands.py.

◆ handle_render_template()

None homeassistant.components.websocket_api.commands.handle_render_template ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle render_template command.

Definition at line 600 of file commands.py.

◆ handle_subscribe_bootstrap_integrations()

None homeassistant.components.websocket_api.commands.handle_subscribe_bootstrap_integrations ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle subscribe bootstrap integrations command.

Definition at line 186 of file commands.py.

◆ handle_subscribe_entities()

None homeassistant.components.websocket_api.commands.handle_subscribe_entities ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle subscribe entities command.

Definition at line 405 of file commands.py.

◆ handle_subscribe_events()

None homeassistant.components.websocket_api.commands.handle_subscribe_events ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle subscribe events command.

Definition at line 145 of file commands.py.

◆ handle_subscribe_trigger()

None homeassistant.components.websocket_api.commands.handle_subscribe_trigger ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle subscribe trigger command.

Definition at line 726 of file commands.py.

◆ handle_supported_features()

None homeassistant.components.websocket_api.commands.handle_supported_features ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle setting supported features.

Definition at line 910 of file commands.py.

◆ handle_test_condition()

None homeassistant.components.websocket_api.commands.handle_test_condition ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle test condition command.

Definition at line 777 of file commands.py.

◆ handle_unsubscribe_events()

None homeassistant.components.websocket_api.commands.handle_unsubscribe_events ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle unsubscribe events command.

Definition at line 210 of file commands.py.

◆ handle_validate_config()

None homeassistant.components.websocket_api.commands.handle_validate_config ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle validate config command.

Definition at line 868 of file commands.py.

◆ pong_message()

dict[str, Any] homeassistant.components.websocket_api.commands.pong_message ( int  iden)
Return a pong message.

Definition at line 103 of file commands.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.websocket_api.commands._LOGGER = logging.getLogger(__name__)
private

Definition at line 71 of file commands.py.

◆ ALL_SERVICE_DESCRIPTIONS_JSON_CACHE

string homeassistant.components.websocket_api.commands.ALL_SERVICE_DESCRIPTIONS_JSON_CACHE = "websocket_api_all_service_descriptions_json"

Definition at line 69 of file commands.py.