EV-52 round 2: a refused Manual try is not logged later by another source's value
Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
This commit is contained in:
@@ -613,6 +613,44 @@ check(f"T23 Manual (Q2): three tries not taken give the existing Manual "
|
||||
len(mid) == 1 and mid[0].endswith("CHARGER_REFUSED.")
|
||||
and end[1:] == ["Car: set from 10 A to 6 A on 1 phase (Manual)."])
|
||||
|
||||
|
||||
async def stale(shape):
|
||||
"""Review round 2: a refused Manual try is not a request any more once
|
||||
the user changed something or another mode ran. Another source then
|
||||
shows the same value; Manual's adopt must log nothing."""
|
||||
w = carmode.ManualWriter()
|
||||
w.boot = False
|
||||
drv, tr = Drv(ok=False), tracker()
|
||||
|
||||
async def step(a, now, mode=carmode.MANUAL, rev=1):
|
||||
await w.step(drv, reading(state="C", allowed_a=a, setpoint_a=a,
|
||||
phases_allowed=1), mode=mode,
|
||||
want_a=6.0, want_phases=1, rev=rev, clamp=16.0, now=now,
|
||||
tracker=tr, writing=True, status="charging")
|
||||
n0 = LOG.mark()
|
||||
await step(10.0, 100.0) # refused
|
||||
if shape == "solar": # the user picks Solar, then Manual
|
||||
w.user_changed()
|
||||
await step(10.0, 200.0, mode=carmode.SOLAR, rev=2)
|
||||
await step(6.0, 300.0, mode=carmode.SOLAR, rev=2) # Solar's own 6 A
|
||||
w.user_changed()
|
||||
await step(6.0, 500.0, rev=3)
|
||||
elif shape == "off": # Off, the wallbox app sets 6 A
|
||||
await step(10.0, 150.0, mode=carmode.OFF)
|
||||
await step(6.0, 400.0, mode=carmode.OFF)
|
||||
await step(6.0, 500.0)
|
||||
else: # the user changed the value
|
||||
w.user_changed()
|
||||
await step(6.0, 500.0, rev=2)
|
||||
return [m for lv, m, _x in LOG.rec[n0:]
|
||||
if lv != "DEBUG" and m.startswith(SETP)]
|
||||
|
||||
|
||||
for shape in ("solar", "off", "user"):
|
||||
check(f"T23 Manual (review round 2, N2) [{shape}]: a refused try is not "
|
||||
f"logged later when the same value comes from another source",
|
||||
go(stale(shape)) == [])
|
||||
|
||||
# T33: shutdown, the charger refuses all 3 release tries.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user