Files
core/homeassistant/components/sensor
ehendrix23 d2e102ee2f Init statistics sensor upon HASS start (#18236)
* Update query to include maxAge

Updated the query from recorded to include MaxAge if set; reducing the amount of records retrieved that would otherwise be purged anyway for the sensor.

* Initialization upon HASS start

Register the state listener and read previous information from recorder once HASS is started.

* Updated test_statistics.py for HASS start

Updated test_statistics.py to start HASS and wait it is completed before running test.

* Added newline in docstring

Added newline in docstring.

* Added start of HASS to test_initialize_from_database_with_maxage

Added start of HASS to new test test_initialize_from_database_with_maxage.

* Updates based on review

Following updates based on review:
-) Removed self._hass and passing hass
-) Changed async_add_job to async_create_task
-) For state update, calling async_schedule_update_ha_state
2018-11-14 15:13:32 +01:00
..
2018-10-21 20:34:28 +02:00
2018-08-24 16:37:30 +02:00
2018-10-01 08:55:43 +02:00
2018-10-01 08:55:43 +02:00
2018-10-14 17:12:34 +02:00
2018-10-02 07:32:03 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-10-01 08:55:43 +02:00
2018-08-24 16:37:30 +02:00
2018-10-17 08:38:03 +02:00
2018-10-01 08:55:43 +02:00
2018-08-24 16:37:30 +02:00
2018-10-01 08:55:43 +02:00
2018-11-04 09:50:00 +01: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-10-01 08:55:43 +02:00
2018-08-24 16:37:30 +02:00
2018-10-20 22:07:47 +02:00
2018-08-24 16:37:30 +02:00
2018-10-01 08:55:43 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-09-16 01:17:47 +02:00
2018-08-24 16:37:30 +02:00
2018-10-01 08:55:43 +02:00
2018-10-01 08:55:43 +02:00
2018-08-24 16:37:30 +02:00
2018-10-01 08:55:43 +02:00
2018-10-01 08:55:43 +02:00
2018-10-15 12:24:21 +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-10-11 07:43:15 +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-10-01 08:55:43 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-10-01 08:55:43 +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-10-20 15:30: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-10-01 08:55:43 +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-10-01 14:44:11 +02:00
2018-10-01 08:55:43 +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-10-15 13:21:21 -06:00
2018-10-01 08:55:43 +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-10-16 10:06:00 +02:00
2018-08-24 16:37:30 +02:00
2018-11-06 12:34:11 +01:00
2018-10-01 08:55:43 +02:00
2018-10-09 22:37:50 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-11-07 08:52:51 +02:00
2018-10-01 08:55:43 +02:00
2018-08-24 16:37:30 +02:00
2018-11-01 13:25:45 +01:00
2018-11-08 19:19:30 +01:00
2018-10-01 08:55:43 +02:00
2018-07-18 10:54:54 +02:00
2018-08-24 16:37:30 +02:00
2018-10-25 23:15:20 +03:00
2018-10-01 08:55:43 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-11-13 11:29:04 +01:00
2018-10-01 08:55:43 +02:00
2018-08-24 16:37:30 +02:00
2018-08-24 16:37:30 +02:00
2018-10-02 11:03:09 +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-10-01 08:55:43 +02:00
2018-08-24 16:37:30 +02:00
2018-10-01 08:55:43 +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