Files
Andy DixonandCopilot 60c787d041 Infer charging state from trend of last 50 data points
When no state field is configured, the panel now uses a least-squares
slope over the most recent ≤ 50 data points to determine whether the
battery is charging, on battery, or stable — instead of relying on the
overall first-to-last rate which could be misleading over long ranges.

Priority order for state resolution:
1. Explicit state field (if enabled and configured)
2. Inferred trend from last ≤ 50 points (always computed)

The slope threshold (0.01) avoids flicker from sensor noise.
Status badge now shows 'On Battery' instead of 'Discharging'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-24 13:20:27 +01:00
..
2025-10-11 18:36:06 +02:00
2025-10-13 18:00:25 +02:00