Skip to content

v1.2.1 — Persist battery consumption state

Choose a tag to compare

@Xunil99 Xunil99 released this 21 Apr 18:51

Bugfix

Last Ride Battery sensors stayed on "Unknown" after HA restart.

Previously, the state used to compute battery consumption (_prev_delivered_wh, _prev_activity_ids, _activity_consumption) was kept only in memory. After any Home Assistant restart or integration reload (including HACS updates), it was lost and the Last Ride Battery sensors stayed on "Unknown" until a new ride AND a Wh delta coincided in the same poll.

The state is now persisted via HA's Store helper (`.storage/ha_bosch_ebike_consumption_state`) and restored at startup. Sensors keep their values across restarts and resume tracking immediately.

Installation

Update via HACS, restart Home Assistant. No configuration changes required.