EV-20 review r3: a held read moves no plan count; only the meter-age pause may fire
On a held charger read no writer steps and the Solar plan does nothing: no phase change or switching start begins, no _set or end_switch, ok_since, up_since, down_since, low_since and set_at stay, and the hold pause does not fire; a decision due then runs on the next real reading. The one exception is the pause by the meter's age (C18, SolarWriter.held_pause). Rows: the reviewer's three shapes with 1- and 2-read gaps on and before the decision cycle, and the hold pause on a held cycle. DECISIONS wording fixed. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
This commit is contained in:
@@ -993,6 +993,26 @@ class SolarWriter(ManualWriter):
|
||||
"prev": None, "from": r.phases_allowed}
|
||||
|
||||
# ------------------------------------------------------------- step
|
||||
async def held_pause(self, drv, r, *, sun, now, tracker) -> None:
|
||||
"""EV-20 (C18, PM design r3): on a held charger read only the pause by
|
||||
the meter's age may come (0 A): nothing else in the plan moves, no
|
||||
phase change begins or goes on, no retry. Called instead of `step`."""
|
||||
if not self.engaged or self.seq is not None or self.hold \
|
||||
or self.fault is not None or self.restart \
|
||||
or self.plan.a <= 0.0 or self.plan.switch:
|
||||
return
|
||||
if not getattr(sun, "silent", False) \
|
||||
or getattr(sun, "unknown_s", 0.0) < sun.pause_s:
|
||||
return
|
||||
self.nz_block = self.held_step = True
|
||||
try:
|
||||
self.plan.pause("unknown")
|
||||
cur = None if r is None else (
|
||||
r.allowed_a if r.allowed_a is not None else r.setpoint_a)
|
||||
await self._put(drv, 0.0, cur, now, tracker)
|
||||
finally:
|
||||
self.nz_block = self.held_step = False
|
||||
|
||||
async def step(self, drv, r, *, mode, sun, clamp, now, tracker, writing,
|
||||
status, clock=None, held=False):
|
||||
"""One cycle. `sun` is `SunInputs` (None outside Solar); `writing` is
|
||||
|
||||
Reference in New Issue
Block a user