diff --git a/goodwe_controller/test_safety90.py b/goodwe_controller/test_safety90.py index 8d5840b..fffff28 100644 --- a/goodwe_controller/test_safety90.py +++ b/goodwe_controller/test_safety90.py @@ -266,6 +266,20 @@ check(f"⭐ ...each quarter's gap is counted on its own: a long gap at a low " f"load does not hide a shorter one in the next quarter ({a:.1f} W)", a <= AIM + TOL and sum("PEAK_GUARD_GAP" in e for e in c.events) == 2) + + +def dip(t): + return 3000.0 if 450 <= t < 700 else 6500.0 + + +(rows, c), _o, a, b = case("N=1 two gaps, the second at a lower load", 1, + dip, {"a": 99.0}, [(300, 360), (500, 560)]) +at = [float(e.split("counted at ")[1].split(" W")[0]) for e in c.events + if "PEAK_GUARD_GAP" in e] +check(f"⭐ ...two gaps in one quarter: the second, at a lower load, does not " + f"price the first one down (counted at {at}; {a:.1f} W)", + a <= AIM + TOL and len(at) == 2 and min(at) >= 6400.0) + # ============================================================================ # print("\n5. start-up mid-quarter (the add-on starts 450 s into the quarter)") UI = {}