🐛 Keep device energy totals monotonic #73
No reviewers
Labels
No labels
v1.0 · bloquant
v1.0 · majeur
v1.0 · mineur
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mat/homeassistant-comwatt!73
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-monotonic-energy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Fixes the device energy regression described in GitHub issue #50:
https://github.com/MateoGreil/homeassistant-comwatt/issues/50
The WebSocket power integral can temporarily exceed Comwatt's official hourly bucket. Reconciliation then applies a negative correction to a sensor exposed as
total_increasing, causing backward state transitions and negative Recorder deltas.Impact
*_total_energysensors never decrease in Home Assistant.Implementation notes
Verification
compileallpassedgit diff --checkpassedThis PR is intentionally opened as a draft for review.
WIP: 🐛 Keep device energy totals monotonicto 🐛 Keep device energy totals monotonic