MAINT-28: during a real peak the maintenance charge stays paused until the house is clear of the aim
infra-pin / fresh (pull_request) Successful in 2s
checks / unit (pull_request) Failing after 1h10m11s

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-11-12 21:51:56 +01:00
co-authored by Claude
parent 1b5f7c9ccb
commit 8cd10ee6aa
5 changed files with 278 additions and 2 deletions
+7 -2
View File
@@ -564,8 +564,13 @@ class CycleMixin:
maint_aim = peakguard.quarter_target_w(
float(self.o.get("peak_cap_w", 3500)),
self.peak_margin_w, _reading)
if peakguard.shaping_suspended(
self.peak_guard, self.peak_fc, maint_aim):
# MAINT-28: stays paused until the house is clear of the aim.
house = (None if self.grid is None or self.site_batt_w is None
else float(self.grid) + float(self.site_batt_w))
self._maint_peak_hold = peakguard.shaping_held(
self._maint_peak_hold, self.peak_guard, 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
# action log of the very context that explains it.