MAINT-28: keep the single shaping_suspended(.., maint_aim) call site (test_peak_margin pin); shaping_held takes its answer
checks / unit (pull_request) Successful in 32m46s
infra-pin / fresh (pull_request) Successful in 1s

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-11-12 23:58:19 +01:00
co-authored by Claude
parent 23359a047d
commit edf30f345a
4 changed files with 18 additions and 11 deletions
+4 -3
View File
@@ -572,11 +572,12 @@ class CycleMixin:
# (SAFETY-87 / SAFETY-119 pins).
house = (None if self.grid is None or self.site_batt_w is None
else float(self.grid) + float(self.site_batt_w))
_susp = peakguard.shaping_suspended(
self.peak_guard, self.peak_fc, maint_aim)
self._maint_peak_hold = peakguard.shaping_held(
_peak_held and len(self.inverters) > 1
_susp, _peak_held and len(self.inverters) > 1
and maint_aim > self.peak_aim_w(),
self.peak_guard, self.peak_fc,
maint_aim, house)
self.peak_fc, maint_aim, house)
if self._maint_peak_hold:
# Edge-logged: level-logging here would write one line per
# cycle for as long as the event lasts and flush the 40-line