Merge release/1.0 into safety-78-drain-at-two
checks / unit (pull_request) Successful in 18m49s
infra-pin / fresh (pull_request) Successful in 2s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
goodwe-review
2026-09-29 21:53:47 +02:00
7 changed files with 558 additions and 9 deletions
+7
View File
@@ -1259,6 +1259,13 @@ check(f"the saturating fixture ({NET2:.0f} W) is a load the real ingest "
f"accepts, not one it rejects as implausible", NET2 < PLAUSIBLE_MAX_W)
print(f" saturated case: {c2.peak_guard.explain()}")
check("a load larger than the inverter saturates the guard", c2.peak_guard.saturated)
# SAFETY-81 review: the alarm must hold ALARM_HOLD_S first. The fixture runs on
# the wall clock, so the start of the hold is moved back instead of waited out.
check("...but not on its first cycle: it must hold peakguard.ALARM_HOLD_S "
"(SAFETY-81)", hass2.notifications.count("goodwe_peak_saturated") == 0
and c2._peak_high_since is not None)
c2._peak_high_since -= timedelta(seconds=peakguard.ALARM_HOLD_S)
asyncio.get_event_loop_policy().new_event_loop().run_until_complete(c2.cycle())
check("...and THAT raises exactly one notification, with its own id - the one "
"state where the money will be spent and a human is the only remaining "
"actuator", hass2.notifications.count("goodwe_peak_saturated") == 1)