Files
core/homeassistant/components/sensor
Giuseppe 9ea0c409e6 Improve NetAtmo sensors update logic (#14866)
* Added a "last update" sensor that could be used by automations + cosmetic changes

* Improved the update logic of sensor data

The platform is now continuously adjusting the refresh interval
in order to synchronize with the expected next update from the
NetAtmo cloud. This significantly improves reaction time of
automations while keeping the refresh time to the recommended
value (10 minutes).

* Linting

* Incorporated the advanced Throttle class to support adaptive
throttling, as opposed to integrating it in the core framework.

Following code review, it was suggested to implement the
specialised Throttle class in this platform instead of making a
change in the general util package. Except that the required change
(about 4 LoC) is part of the only relevant piece of code of that
class, therefore this commit includes a full copy of the Throttle
class from homeassistant.util, plus the extra feature to support
adaptive throttling.

* Cosmetic changes on the introduced "last updated" sensor

* Alternate implementation for the adaptive throttling

Ensure the updates from the cloud are throttled and adapted to the
last update time provided by NetAtmo, without using the Throttle
decorator. Similar logic and similar usage of a lock to protect
the execution of the remote update.

* Linting
2018-07-10 12:30:48 +02:00
..
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-07-09 14:39:28 +02:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:58:16 +02:00
2018-06-29 17:25:49 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-07-01 13:01:48 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-07-01 11:57:01 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00
2018-06-25 13:05:07 -04:00