Merged
Conversation
…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.
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix errorenous spike introduction on panel reboot. only clear cache.