Functions | |
| bytes | _ws_get_list_statistic_ids (HomeAssistant hass, int msg_id, Literal["mean", "sum"]|None statistic_type=None) |
| bytes | _ws_get_statistic_during_period (HomeAssistant hass, int msg_id, dt|None start_time, dt|None end_time, str statistic_id, set[Literal["max", "mean", "min", "change"]]|None types, dict[str, str] units) |
| bytes | _ws_get_statistics_during_period (HomeAssistant hass, int msg_id, dt start_time, dt|None end_time, set[str]|None statistic_ids, Literal["5minute", "day", "hour", "week", "month"] period, dict[str, str] units, set[Literal["change", "last_reset", "max", "mean", "min", "state", "sum"]] types) |
| None | async_setup (HomeAssistant hass) |
| None | ws_adjust_sum_statistics (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
| None | ws_change_statistics_unit (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
| None | ws_clear_statistics (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
| None | ws_get_statistic_during_period (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
| None | ws_get_statistics_during_period (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
| None | ws_get_statistics_metadata (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
| None | ws_handle_get_statistics_during_period (HomeAssistant hass, websocket_api.ActiveConnection connection, dict msg) |
| None | ws_handle_list_statistic_ids (HomeAssistant hass, websocket_api.ActiveConnection connection, dict msg) |
| None | ws_import_statistics (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
| None | ws_list_statistic_ids (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
| None | ws_update_statistics_issues (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
| None | ws_update_statistics_metadata (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
| None | ws_validate_statistics (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg) |
Variables | |
| int | CLEAR_STATISTICS_TIME_OUT = 10 |
| UNIT_SCHEMA | |
| int | UPDATE_STATISTICS_METADATA_TIME_OUT = 10 |
The Recorder websocket API.
|
private |
Fetch a list of available statistic_id and convert them to JSON. Runs in the executor.
Definition at line 247 of file websocket_api.py.
|
private |
Fetch statistics and convert them to json in the executor.
Definition at line 99 of file websocket_api.py.
|
private |
Fetch statistics and convert them to json in the executor.
Definition at line 156 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.async_setup | ( | HomeAssistant | hass | ) |
Set up the recorder websocket API.
Definition at line 84 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_adjust_sum_statistics | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Adjust sum statistics. If the statistics is stored as NORMALIZED_UNIT, it's allowed to make an adjustment in VALID_UNIT
Definition at line 453 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_change_statistics_unit | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Change the unit_of_measurement for a statistic_id. All existing statistics will be converted to the new unit.
Definition at line 426 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_clear_statistics | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Clear statistics for a list of statistic_ids. Note: The WS call posts a job to the recorder's queue and then returns, it doesn't wait until the job is completed.
Definition at line 333 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_get_statistic_during_period | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Handle statistics websocket command.
Definition at line 131 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_get_statistics_during_period | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Handle statistics websocket command.
Definition at line 240 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_get_statistics_metadata | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Get metadata for a list of statistic_ids.
Definition at line 368 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_handle_get_statistics_during_period | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict | msg | ||
| ) |
Handle statistics websocket command.
Definition at line 186 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_handle_list_statistic_ids | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict | msg | ||
| ) |
Fetch a list of available statistic_id.
Definition at line 261 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_import_statistics | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Import statistics.
Definition at line 528 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_list_statistic_ids | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Fetch a list of available statistic_id.
Definition at line 282 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_update_statistics_issues | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Update statistics issues.
Definition at line 313 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_update_statistics_metadata | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Update statistics metadata for a statistic_id. Only the normalized unit of measurement can be updated.
Definition at line 387 of file websocket_api.py.
| None homeassistant.components.recorder.websocket_api.ws_validate_statistics | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict[str, Any] | msg | ||
| ) |
Fetch a list of available statistic_id.
Definition at line 295 of file websocket_api.py.
| int homeassistant.components.recorder.websocket_api.CLEAR_STATISTICS_TIME_OUT = 10 |
Definition at line 54 of file websocket_api.py.
| homeassistant.components.recorder.websocket_api.UNIT_SCHEMA |
Definition at line 57 of file websocket_api.py.
| int homeassistant.components.recorder.websocket_api.UPDATE_STATISTICS_METADATA_TIME_OUT = 10 |
Definition at line 55 of file websocket_api.py.