EV-21 fix round 1 (formal round 4): C14 cut due while batteries charge; C15 grace once per value
checks / unit (pull_request) Successful in 46m9s
infra-pin / fresh (pull_request) Successful in 1s

C14 (PM Q2): slowing a battery charge counts as the batteries taking more, so the cut is due whatever the batteries do; their charge counts only as headroom for the 15 s wait. C15 (PM Q1): sent_at is renewed only for a new value, so a retry of a refused cut gets no new 2 s grace. test_ev21_fix1.py: both red on 36e9dd7; C16, C18 and Q1's other writer pinned as the code has them. Test shapes: slow batteries and refusals start after Solar's own start, which C14 would otherwise cut on its start blip; T38 cover off from 300 s; T46 bounds the excess; T39 counts writes after the cut.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ems-agent
2026-11-27 01:33:41 +01:00
co-authored by Claude
parent 36e9dd765e
commit 5759e9dc9f
9 changed files with 250 additions and 36 deletions
+2 -2
View File
@@ -3375,8 +3375,8 @@ changes at most once per 30 seconds and only by 1 A or more.
logs one warning, until you press Solar again or the charger shows Solar's
value.
- **The peak limit: the car is cut first.** When the 15-minute period heads
over the peak limit and the batteries would have to give more for it, Solar
lowers the car first: by the excess, to 0 A when less than 6 A would be left.
over the peak limit, Solar lowers the car first, also while the batteries
could instead charge less: by the excess, to 0 A when less than 6 A would be left.
It waits at most 15 seconds, and only while the batteries can still give
more; it does not wait when they are at full power or at the peak reserve,
when a battery reading is missing, with `ev_batt_cover` off, or in the last 2