EV-05 round 8: Off respects the owed-only rule; grade out only a car Solar runs
checks / unit (pull_request) Successful in 26m14s
infra-pin / fresh (pull_request) Successful in 1s

Review of fa11dc3:
- Solar to Off writes no 0 A when Solar never had the charger (shadow or a
  stopped control since the start) or its not-writing 0 A is already taken
  (N10, Expected 11), as the shutdown does since round 7.
- car_solar_can_cut() also needs a car Solar runs: plan.a > 0, its own phase
  change, or its own 0 A inside EV-15's OWN_PAUSE_MAX_S.

Tests: the four p_off shapes (and Manual); p_paused at 1000 s and 890 s and
an own pause older than 85 s, each against an Off twin; the near-end rule
with slow batteries that keep headroom (review p_ne2).

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ems-agent
2026-11-18 22:17:21 +01:00
co-authored by Claude
parent fa11dc3d85
commit e348a808ff
4 changed files with 121 additions and 8 deletions
+7 -3
View File
@@ -810,9 +810,13 @@ class SolarWriter(ManualWriter):
return
if mode != MANUAL: # Off: 0 A until taken, then nothing
self.seq = None
await self._exit_zero("off", drv, cur, now, tracker)
if self.zero_owed:
return # tried again next cycle (or gave up)
# Round 8: not when Solar never had the charger (shadow or a
# stopped control since the start) or its not-writing 0 A is
# already taken: nothing over another writer (N10).
if not (self.out and (self.zero_ok or not self.had_control)):
await self._exit_zero("off", drv, cur, now, tracker)
if self.zero_owed:
return # tried again next cycle (or gave up)
self._leave() # Manual writes its own current
return
self.engaged = True