Skip to content

Release/v2.5.3#132

Merged
cayossarian merged 4 commits intomainfrom
release/v2.5.3
Apr 9, 2026
Merged

Release/v2.5.3#132
cayossarian merged 4 commits intomainfrom
release/v2.5.3

Conversation

@cayossarian
Copy link
Copy Markdown
Member

fix errorenous spike introduction on panel reboot. only clear cache.

…rgy dips

The 2.5.2 property clear caused _parse_float('') to return 0.0 for energy
counters during panel reboots or network interruptions, triggering false
dip-compensation offsets that permanently inflated energy sensor values.

Remove the three .clear() calls from _handle_description(). Keep the
generation counter increment so consumer snapshot caches are invalidated
and rebuilt from current accumulator state. Pre-reboot values serve as
safe placeholders until the panel re-publishes fresh data.
Mark 2.5.2 as retired due to false energy dip spikes caused by property
clearing on lifecycle resets. Carry forward the snapshot cache invalidation
entry to 2.5.3 alongside the preservation fix.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Releases v2.5.3 to fix false energy “dip spike” offsets introduced by clearing Homie property values on panel reboot, while still invalidating snapshot caches.

Changes:

  • Stop clearing stored Homie property/target/timestamp state on lifecycle-reset $description; only bump generation to invalidate snapshot caches.
  • Update/expand tests to assert preserved placeholder values across reboot and cache invalidation via generation.
  • Bump package version to 2.5.3 and document the regression/retirement of 2.5.2 in the changelog (plus lockfile updates).

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/span_panel_api/mqtt/accumulator.py Preserve property state on reboot; keep generation bump for cache invalidation; update logging/comments.
tests/test_accumulator.py Update reboot semantics tests to expect preserved values/timestamps/targets and generation behavior.
tests/test_mqtt_homie.py Ensure consumer snapshot cache invalidation still happens on reboot while values are preserved until republished.
CHANGELOG.md Add 2.5.3 notes and mark 2.5.2 as retired due to the spike regression.
pyproject.toml Version bump to 2.5.3.
uv.lock Lockfile refresh (additional wheels / updated entries).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The generation counter increments on the initial $description too
(0→1), not just on lifecycle resets. Updated the __init__ comment
and generation property docstring to accurately reflect this.
@cayossarian cayossarian merged commit 7648da1 into main Apr 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants