EV-21 fix round 1 (formal round 4): C14 cut due while batteries charge; C15 grace once per value
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:
@@ -314,13 +314,10 @@ class CarMixin:
|
||||
# C12: Solar's own phase change holds the car at 0 A on its way to a
|
||||
# current: a cut due then ends it at that 0 A (no closing current).
|
||||
seq_on = w.seq is not None and w.plan.a > 0.0
|
||||
# The batteries would have to give more than now (the guard's
|
||||
# `wanted_w`, on the projection WITH the car): a charge that only
|
||||
# has to slow down is the loop's, not a cut. Unknown: they add
|
||||
# nothing (Q4).
|
||||
batt = self.site_batt_w
|
||||
wants = batt is None or float(batt) + ex > 0.0
|
||||
due = ex > 0.0 and wants and running and (drawing or seq_on)
|
||||
# PM Q2 (formal C14): slowing a battery charge counts as the
|
||||
# batteries taking more, so a cut is due whatever they do now; their
|
||||
# charge only counts as headroom for the 15 s wait.
|
||||
due = ex > 0.0 and running and (drawing or seq_on)
|
||||
n = self._car_cut_n()
|
||||
if st["cap"] is not None:
|
||||
# A cut stands: deeper only if the excess grows (OQ7); the
|
||||
|
||||
Reference in New Issue
Block a user