Functions | |
| tuple[datetime.datetime, datetime.datetime] | async_calculate_period (datetime.timedelta|None duration, Template|None start_template, Template|None end_template) |
| float | floored_timestamp (datetime.datetime incoming_dt) |
| float | pretty_ratio (float value, tuple[datetime.datetime, datetime.datetime] period) |
Variables | |
| _LOGGER = logging.getLogger(__name__) | |
| string | DURATION_END = "end" |
| string | DURATION_START = "start" |
Helpers to make instant statistics about your history.
| tuple[datetime.datetime, datetime.datetime] homeassistant.components.history_stats.helpers.async_calculate_period | ( | datetime.timedelta | None | duration, |
| Template | None | start_template, | ||
| Template | None | end_template | ||
| ) |
Parse the templates and return the period.
Definition at line 22 of file helpers.py.
| float homeassistant.components.history_stats.helpers.floored_timestamp | ( | datetime.datetime | incoming_dt | ) |
Calculate the floored value of a timestamp.
Definition at line 87 of file helpers.py.
| float homeassistant.components.history_stats.helpers.pretty_ratio | ( | float | value, |
| tuple[datetime.datetime, datetime.datetime] | period | ||
| ) |
Format the ratio of value / period duration.
Definition at line 76 of file helpers.py.
|
private |
Definition at line 14 of file helpers.py.
| string homeassistant.components.history_stats.helpers.DURATION_END = "end" |
Definition at line 18 of file helpers.py.
| string homeassistant.components.history_stats.helpers.DURATION_START = "start" |
Definition at line 17 of file helpers.py.