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")