SAFETY-90 review: count the start-up seconds like a gap

While the add-on is down the batteries are at 0 W (it sets 0 W when it
stops; the ESP32 watchdog after 30 s), so the import before its first
reading was the house, not the aim. Those seconds now count at
gap_w(limit, the import seen first), and after a restart the restored
reading's held 30 s is topped up the same way. Status row: "counted as
high use". Tests take the pre-start import as the house (batteries at
0 W) and add restarts of 10/60/150 s with a restored averager.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude (SAFETY-90 review)
2026-10-05 12:24:33 +02:00
parent 9d3fbe1be9
commit 8dfe91e1d2
5 changed files with 120 additions and 43 deletions
+2 -2
View File
@@ -794,9 +794,9 @@ def row_peak_guard_blind(why: str) -> str:
def row_peak_guard_unmeasured() -> str:
"""SAFETY-90. Before the first reading; that part counts as on target."""
"""SAFETY-90. Before the first reading; that part counts as high use."""
return ("Peak guard: part of this 15-minute period was not measured, "
"counted as on target")
"counted as high use")
def row_peak_guard_on(floor_w, limit_w, *, shadow: bool = False) -> str: