Classes | |
| class | HistoryLiveStream |
Functions | |
| None | _async_events_consumer (dt subscriptions_setup_complete_time, ActiveConnection connection, int msg_id, asyncio.Queue[Event] stream_queue, bool no_attributes) |
| None | _async_send_empty_response (ActiveConnection connection, int msg_id, dt start_time, dt|None end_time) |
| dt|None | _async_send_historical_states (HomeAssistant hass, ActiveConnection connection, int msg_id, dt start_time, dt end_time, list[str]|None entity_ids, bool include_start_time_state, bool significant_changes_only, bool minimal_response, bool no_attributes, bool send_empty) |
| None | _async_subscribe_events (HomeAssistant hass, list[CALLBACK_TYPE] subscriptions, Callable[[Event[Any]], None] target, list[str] entity_ids, bool significant_changes_only, bool minimal_response) |
| dict[str, list[dict[str, Any]]] | _events_to_compressed_states (Iterable[Event] events, bool no_attributes) |
| tuple[float, dt|None, bytes|None] | _generate_historical_response (HomeAssistant hass, int msg_id, dt start_time, dt end_time, list[str]|None entity_ids, bool include_start_time_state, bool significant_changes_only, bool minimal_response, bool no_attributes, bool send_empty) |
| dict[str, Any] | _generate_stream_message (dict[str, list[dict[str, Any]]] states, dt start_day, dt end_day) |
| bytes | _generate_websocket_response (int msg_id, dt start_time, dt end_time, dict[str, list[dict[str, Any]]] states) |
| dict[str, Any] | _history_compressed_state (State state, bool no_attributes) |
| bytes | _ws_get_significant_states (HomeAssistant hass, int msg_id, dt start_time, dt|None end_time, list[str]|None entity_ids, bool include_start_time_state, bool significant_changes_only, bool minimal_response, bool no_attributes) |
| None | async_setup (HomeAssistant hass) |
| None | ws_get_history_during_period (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
| None | ws_stream (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
Variables | |
| _LOGGER = logging.getLogger(__name__) | |
Websocket API for the history integration.
|
private |
Stream events from the queue.
Definition at line 328 of file websocket_api.py.
|
private |
Send an empty response when we know all results are filtered away.
Definition at line 191 of file websocket_api.py.
|
private |
Fetch history significant_states and send them to the client.
Definition at line 270 of file websocket_api.py.
|
private |
Subscribe to events for the entities and devices or all. These are the events we need to listen for to do the live history stream.
Definition at line 365 of file websocket_api.py.
|
private |
Convert events to a compressed states.
Definition at line 314 of file websocket_api.py.
|
private |
Generate a historical response.
Definition at line 216 of file websocket_api.py.
|
private |
Generate a history stream message response.
Definition at line 177 of file websocket_api.py.
|
private |
Generate a websocket response.
Definition at line 202 of file websocket_api.py.
|
private |
Convert a state to a compressed state.
Definition at line 303 of file websocket_api.py.
|
private |
Fetch history significant_states and convert them to json in the executor.
Definition at line 65 of file websocket_api.py.
| None homeassistant.components.history.websocket_api.async_setup | ( | HomeAssistant | hass | ) |
Set up the history websocket API.
Definition at line 59 of file websocket_api.py.
| None homeassistant.components.history.websocket_api.ws_get_history_during_period | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Handle history during period websocket command.
Definition at line 109 of file websocket_api.py.
| None homeassistant.components.history.websocket_api.ws_stream | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Handle history stream websocket command.
Definition at line 413 of file websocket_api.py.
|
private |
Definition at line 44 of file websocket_api.py.