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:
@@ -370,11 +370,21 @@ class CarMixin:
|
||||
return
|
||||
held = bool(self.car.held)
|
||||
now = self.car_now()
|
||||
if held and self.car_mode != carmode.SOLAR \
|
||||
and not self.car_solar.engaged:
|
||||
sun = None
|
||||
if self.car_mode == carmode.SOLAR:
|
||||
sun = getattr(self, "_car_sun_now", None) \
|
||||
or self.car_sun_inputs(now)
|
||||
if held:
|
||||
# EV-20 rig round 2 (PM): the charger missed a read for less than
|
||||
# `stale_input_s`; the last trusted figure stands and nothing is
|
||||
# decided or written from the gap.
|
||||
# decided or written from the gap. No writer steps and no plan
|
||||
# count (start, phase change, hold) moves (review r3, PM design);
|
||||
# a decision due now runs on the next real reading. The one
|
||||
# exception: Solar's pause by the meter's age (C18).
|
||||
if sun is not None and self.car_writing():
|
||||
await self.car_solar.held_pause(
|
||||
self.charger, self.car.reading, sun=sun, now=now,
|
||||
tracker=self.car)
|
||||
return
|
||||
if self.car_mode != carmode.SOLAR and not held:
|
||||
await self.car_writer.step(
|
||||
@@ -387,16 +397,12 @@ class CarMixin:
|
||||
if self.car_mode == carmode.SOLAR or w.engaged:
|
||||
# C6: one write clock: Manual's latest non-zero write counts.
|
||||
w.other_at = self.car_writer.nonzero_at
|
||||
sun = None
|
||||
if self.car_mode == carmode.SOLAR:
|
||||
sun = getattr(self, "_car_sun_now", None) \
|
||||
or self.car_sun_inputs(now)
|
||||
await w.step(
|
||||
self.charger, self.car.reading, mode=self.car_mode,
|
||||
sun=sun,
|
||||
clamp=self.car_clamp(), now=now, tracker=self.car,
|
||||
writing=self.car_writing(), status=self.car.status(now, True),
|
||||
clock=self.car_now, held=held)
|
||||
clock=self.car_now)
|
||||
|
||||
# ------------------------------------------------------- EV-20: Solar
|
||||
def car_may_charge(self, inv) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user