Florian Werner 8a2bc99f63 Add rate of change to statistics sensor (#15632)
* always export max_age/min_age

* downgrade errors of missing data
on start with empty recorder database these errors are logged multiple times:
ERROR (MainThread) [homeassistant.components.sensor.statistics] mean requires at least one data point
ERROR (MainThread) [homeassistant.components.sensor.statistics] variance requires at least two data points

downgrade them to debug as they are not meaningful to end users

* add change_rate attribute
this calculates the average change rate of all data points

* simplify count, reorder attribute calculation

* reorder initialization

* reorder attribute names

* don't use min/max for min_age/max_age

* add test case

* style

* style

* sort constants

* init variables with None

* add precision config setting

* round to precision

* test round
2018-09-08 01:10:08 +02:00
..
2018-09-03 13:21:37 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-31 16:47:10 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-29 21:13:01 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-09-01 23:30:34 +02:00
2018-08-19 22:29:08 +02:00
2018-08-24 16:37:30 +02:00
2018-09-04 09:22:44 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-09-02 12:51:25 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-09-06 12:31:08 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-26 12:28:44 +02:00
2018-07-18 10:54:54 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-09-04 01:11:40 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-07-23 10:16:05 +02:00