From 0ef8de26cba626751e1df7f53c31029b723265b4 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 02:05:05 +0100 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w --- goodwe_controller/DECISIONS/EV-20-solar-mode.md | 2 +- goodwe_controller/app/carmode.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/goodwe_controller/DECISIONS/EV-20-solar-mode.md b/goodwe_controller/DECISIONS/EV-20-solar-mode.md index 7830e24..c5bb9cf 100644 --- a/goodwe_controller/DECISIONS/EV-20-solar-mode.md +++ b/goodwe_controller/DECISIONS/EV-20-solar-mode.md @@ -168,7 +168,7 @@ one small set of facts and derives every path from them: plan pauses. 0 A is always allowed. Also on a held read (`nz_block`). - **The age pause on a held read (C18):** on a held cycle Solar still steps (Manual does not), so a pause due on that cycle is not slipped; it can only - write 0 A there. + write a NEW 0 A there (no retry to a charger that is not answering). - **Accepted (PM, P9g):** a frozen charger that also stops answering is flagged only once it answers again; the 15 s safe path covers the gap. diff --git a/goodwe_controller/app/carmode.py b/goodwe_controller/app/carmode.py index 3450d77..429e195 100644 --- a/goodwe_controller/app/carmode.py +++ b/goodwe_controller/app/carmode.py @@ -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: