* 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> |
||
---|---|---|
.. | ||
translations | ||
__init__.py | ||
config_flow.py | ||
const.py | ||
coordinator.py | ||
manifest.json | ||
sensor.py | ||
strings.json |