EV-05 round 2: the peak cut waits 15 s while a battery can give
checks / unit (pull_request) Successful in 23m32s
infra-pin / fresh (pull_request) Successful in 1s

Owner 2026-11-18 (dev finding 1, brief v4 Expected 8): while a battery is
above its cut-out, the car's peak cut waits until the guard has wanted power
for 15 s in a row (CUT_WAIT_S), so a cloud edge the batteries catch does not
pause the car. It cuts at once with no battery able, or with 120 s or less of
the 15-minute period left (CUT_NEAR_END_S: waiting 15 s then costs at most
8/7 of the cut, taken off the car at once).

Tests: T21/T22 cut at 15 s and not sooner, the period lands under the aim;
T21b a house step and a cloud edge the batteries catch: no cut, no pause;
T24 (c) late in the period: the cut at once, under the aim; T12's cut row
with the batteries at their cut-out. The harness's battery level model was
1000x too fast (round 1); fixed. The 10-hour day: 0 cut pauses in both
priorities.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ems-agent
2026-11-18 10:13:02 +01:00
co-authored by Claude
parent 8ba3e1c337
commit 17a7b299d2
6 changed files with 152 additions and 39 deletions
+5 -1
View File
@@ -244,6 +244,9 @@ def drive(house, sun, *, dur=600.0, ratings=None, socs=None, cap=3500.0,
or g.saturated)),
floor=(None if g is None else g.floor_w),
excess=(None if g is None else g.excess_w),
want=(None if g is None else g.wanted_w),
since=c._car_want_since,
able=c._car_batt_able(), socs=dict(plant.socs),
proj=(None if g is None else g.projected_w),
target=(None if g is None else g.target_w),
would=w.would, single=w.single,
@@ -254,7 +257,8 @@ def drive(house, sun, *, dur=600.0, ratings=None, socs=None, cap=3500.0,
if callable(on_cycle):
on_cycle(plant, c, t)
for u, kwh in (caps or {}).items():
lv = plant.socs[u] - plant.batt_of(u, t) / 36.0 / kwh
# 1 s of W, as a percent of kWh: W / 3600 / (kWh x 1000) x 100
lv = plant.socs[u] - plant.batt_of(u, t) / 36000.0 / kwh
plant.socs[u] = max(0.0, min(100.0, lv))
t += 1.0
await c.car_settle()