* implement coordinator
* fix styling
* fix async_uload_entry
* use async_config_entry_first_refresh
* use const
* fix black
* use KEY_ROUTER
* review comments
* fix black
* ensure the coordinator keeps updating
* fix flake8
* rework setup of entities using coordinator
* styling
* check for failed get_info call
* fix
* fix setup of entities
* simplify
* do not set unique_id and device_info on scanner entity
* Update homeassistant/components/netgear/sensor.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/netgear/device_tracker.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/netgear/router.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* use entry_id instead of unique_id
* unused import
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Set last_reset for integrated entities
For entities which integrate over time (like energy in watt hours) the
iotawattpy library uses the beginning of the year as start date by
default (using relative time specification "y", see [1]). Since
PR #56974 state class has been changed from TOTAL_INCREASING to TOTAL.
However, the relative start date of "y" causes the value to reset to
zero at the beginning of the year.
This fixes it by setting last_reset properly, which takes such resets
into account.
While at it, let's set the cycle to one day. This lowers the load on
IoTaWatt (fetching with start date beginning of the day seems to
response faster than beginning of the year).
[1]: https://docs.iotawatt.com/en/master/query.html#relative-time
* Update homeassistant/components/iotawatt/sensor.py
* Update homeassistant/components/iotawatt/coordinator.py
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* Cleanup sensor expire triggers after reload
* fix test binary_sensor
* Also trigger cleanup parent classes
* Restore an expiring state after a reload
* correct discovery_update
* restore expiring state with remaining time
* Update homeassistant/components/mqtt/binary_sensor.py
description
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Log remaining time
* Move check
* check and tests reload
* remove self.async_write_ha_state()
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Log error if public stations don't provide data
Signed-off-by: cgtobi <cgtobi@gmail.com>
* Only log once
Signed-off-by: cgtobi <cgtobi@gmail.com>
* Update homeassistant/components/netatmo/sensor.py
Co-authored-by: Shay Levy <levyshay1@gmail.com>
Co-authored-by: Shay Levy <levyshay1@gmail.com>