From 91cbdf2f43d4b0641b8a10d1ad70b5efd8b89c79 Mon Sep 17 00:00:00 2001 From: EV-16 reviewer Date: Sat, 21 Nov 2026 12:37:06 +0100 Subject: [PATCH] EV-16 review round 2: pin the unread-SoC rule on the Why's live fallback The fallback (no record yet, or a record of an ended episode) had no check; reading floor_limited alone there survived test_ev16. Test only. Co-Authored-By: Claude --- goodwe_controller/test_ev16.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/goodwe_controller/test_ev16.py b/goodwe_controller/test_ev16.py index dab89da..0d865a6 100644 --- a/goodwe_controller/test_ev16.py +++ b/goodwe_controller/test_ev16.py @@ -519,6 +519,19 @@ for t in range(0, 1200, 5): seq.append(kind(why(c))) check("T9 (long) guard None from the start for 1200 s: one text, 'full'", set(seq) == {"full"}) +# review round 2: the live fallback (no record yet, or one of an ended +# episode) keeps the unread-SoC rule too +for label, rec in (("no record yet", None), + ("a record of an ended episode", [True, None, -1])): + c = S() + c._now = 0.0 + c._car_why_rec = rec + c.peak_guard = G(soc=None) + check(f"N3 {label}: limited with SoC unread is not 'are at'", + kind(why(c)) == "full") + c.peak_guard = G() + check(f"N3 {label}: limited with SoC read shows 'are at' (live state)", + kind(why(c)) == "over") print() print("FAIL: " + ", ".join(fails) if fails else "PASS: every check passed")