EV-20 round 3: on a held read Solar writes only a new 0 A, no retry
A retry on a held cycle went to a charger that was not answering and changed the try count (test_ev20_fuzz T54 N14, seed 1). Held cycles now allow only a new 0 A decision, such as the age pause. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
This commit is contained in:
@@ -734,6 +734,7 @@ class SolarWriter(ManualWriter):
|
||||
self.stuck_wait = None # ... used up: the next start not before
|
||||
self.stuck_warned = False # ... and its one CHARGER_REFUSED was given
|
||||
self.nz_block = False # C17/C18: this step writes 0 A at most
|
||||
self.held_step = False # C18: a held read: only a NEW 0 A goes out
|
||||
|
||||
def owe_start(self) -> None:
|
||||
"""C1: the add-on starts in Off while an exit 0 A of its own was still
|
||||
@@ -844,6 +845,8 @@ class SolarWriter(ManualWriter):
|
||||
if want > TOL_A and self.nz_block:
|
||||
return # C17/C18: 0 A only, no retry or raise
|
||||
if self.sent_a is not None and abs(self.sent_a - want) <= TOL_A:
|
||||
if self.held_step:
|
||||
return # C18: no retry to a charger not answering
|
||||
if self.taken or self.gave_up or (
|
||||
self.fail_at is not None
|
||||
and now - self.fail_at < RETRY_S):
|
||||
@@ -1002,6 +1005,7 @@ class SolarWriter(ManualWriter):
|
||||
# of a phase change); 0 A always may.
|
||||
self.nz_block = bool(held or (sun is not None
|
||||
and getattr(sun, "silent", False)))
|
||||
self.held_step = bool(held)
|
||||
entering = mode == SOLAR and self.mode_was != SOLAR
|
||||
self.mode_was = mode
|
||||
if entering:
|
||||
|
||||
Reference in New Issue
Block a user