From c628099e692fe052ff0614bec71fb4f549f009f1 Mon Sep 17 00:00:00 2001 From: glenn schrooyen Date: Sun, 27 Sep 2026 13:49:17 +0200 Subject: [PATCH] UX-11: the meter WARNING names the limit only, as 'over 30 seconds' TEST-23 showed 'No meter reading for 30 seconds, over the limit of 30 seconds': the age is 30.4 s, which rounds to the limit. The limit alone is always true at the moment the line is logged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LyR88rXETvwhTgx6yHE39p --- goodwe_controller/app/main.py | 5 ++--- goodwe_controller/test_messages.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/goodwe_controller/app/main.py b/goodwe_controller/app/main.py index a5df597..ff4abd0 100644 --- a/goodwe_controller/app/main.py +++ b/goodwe_controller/app/main.py @@ -1916,9 +1916,8 @@ class Controller: if (self.p1.stale and not self._meter_quiet_logged and self.p1.published_age_s > self.p1.max_age_s): self._meter_quiet_logged = True - _LOG.warning("No meter reading for %s, over the limit of %s, " - "so control waits and then sets the battery to " - "0 W.", messages.seconds(self.p1.published_age_s), + _LOG.warning("No meter reading for over %s, so control " + "waits and then sets the battery to 0 W.", messages.seconds(self.p1.max_age_s)) elif not self.p1.stale and self._meter_quiet_logged: self._meter_quiet_logged = False diff --git a/goodwe_controller/test_messages.py b/goodwe_controller/test_messages.py index 6bb209e..7513364 100644 --- a/goodwe_controller/test_messages.py +++ b/goodwe_controller/test_messages.py @@ -877,7 +877,6 @@ DATA = { "main.py:messages.when(brussels(self.tariff_at))", "main.py:messages.duration(TARIFF_MAX_AGE_S)", "main.py:messages.count(len(targets), 'inverter')", - "main.py:messages.seconds(self.p1.published_age_s)", "main.py:messages.seconds(self.p1.max_age_s)", # maintenance.py, mqtt.py, p1.py "maintenance.py:phase", "mqtt.py:err", "p1.py:err", "p1.py:self.host", @@ -1708,8 +1707,8 @@ _mq_info = [r.getMessage() for r in _mq if r.levelno == logging.INFO] check(f"a meter that goes quiet logs one WARNING per episode, not per cycle, " f"and one INFO when readings return ({_mq_warn}, {_mq_info})", len(_mq_warn) == 2 and _mq_info == ["Meter readings are back."] - and _mq_warn[0].startswith("No meter reading for 40 seconds, over the " - "limit of 30 seconds") + and _mq_warn[0] == "No meter reading for over 30 seconds, so control " + "waits and then sets the battery to 0 W." and len(words(_mq_warn[0])) <= LINE_WORDS) # UX-11 item 1: a state file saved before UX-11 holds the long reasons, and