4 Commits

Author SHA1 Message Date
J. Nick Koston
e34853a82a
Switch underlying history stats calculation to use seconds (#77857)
* Switch history stats to report in seconds

Because hours were previously used, the data would always be off because
of the loss of resolution when the time being tracked was in a window
of more than 12s

* Apply suggestions from code review

* Update homeassistant/components/history_stats/sensor.py

* tweak
2023-03-12 23:05:48 -04:00
J. Nick Koston
1c3203abda
Use device class duration for history_stats sensors (#70720) 2022-04-26 19:24:28 +02:00
J. Nick Koston
1d2c949c51
Convert history_stats to use a coordinator (#70388)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-04-25 15:20:06 -07:00
J. Nick Koston
73a368c242
Refactor history_stats to minimize database access (part 2) (#70255) 2022-04-21 09:06:59 -07:00