Manage history stats.
Definition at line 39 of file data.py.
◆ __init__()
| None homeassistant.components.history_stats.data.HistoryStats.__init__ |
( |
|
self, |
|
|
HomeAssistant |
hass, |
|
|
str |
entity_id, |
|
|
list[str] |
entity_states, |
|
|
Template | None |
start, |
|
|
Template | None |
end, |
|
|
datetime.timedelta | None |
duration |
|
) |
| |
Init the history stats manager.
Definition at line 42 of file data.py.
◆ _async_compute_seconds_and_changes()
| tuple[float, int] homeassistant.components.history_stats.data.HistoryStats._async_compute_seconds_and_changes |
( |
|
self, |
|
|
float |
now_timestamp, |
|
|
float |
start_timestamp, |
|
|
float
|
end_timestamp |
|
) |
| |
|
private |
Compute the seconds matched and changes from the history list and first state.
Definition at line 176 of file data.py.
◆ _async_history_from_db()
| None homeassistant.components.history_stats.data.HistoryStats._async_history_from_db |
( |
|
self, |
|
|
float |
current_period_start_timestamp, |
|
|
float |
current_period_end_timestamp |
|
) |
| |
|
private |
Update history data for the current period from the database.
Definition at line 144 of file data.py.
◆ _state_changes_during_period()
| list[State] homeassistant.components.history_stats.data.HistoryStats._state_changes_during_period |
( |
|
self, |
|
|
float |
start_ts, |
|
|
float
|
end_ts |
|
) |
| |
|
private |
Return state changes during a period.
Definition at line 161 of file data.py.
◆ async_update()
Update the stats at a given time.
Definition at line 63 of file data.py.
◆ _duration
| homeassistant.components.history_stats.data.HistoryStats._duration |
|
private |
◆ _end
| homeassistant.components.history_stats.data.HistoryStats._end |
|
private |
◆ _entity_states
| homeassistant.components.history_stats.data.HistoryStats._entity_states |
|
private |
◆ _history_current_period
| homeassistant.components.history_stats.data.HistoryStats._history_current_period |
|
private |
◆ _period
| homeassistant.components.history_stats.data.HistoryStats._period |
|
private |
◆ _previous_run_before_start
| homeassistant.components.history_stats.data.HistoryStats._previous_run_before_start |
|
private |
◆ _start
| homeassistant.components.history_stats.data.HistoryStats._start |
|
private |
◆ _state
| homeassistant.components.history_stats.data.HistoryStats._state |
|
private |
◆ entity_id
| homeassistant.components.history_stats.data.HistoryStats.entity_id |
◆ hass
| homeassistant.components.history_stats.data.HistoryStats.hass |
The documentation for this class was generated from the following file:
- core/homeassistant/components/history_stats/data.py