SAFETY-118: a missing peak forecast reading keeps the unit-fault state
checks / unit (pull_request) Successful in 40m19s
infra-pin / fresh (pull_request) Successful in 1s

A missing reading (unavailable, unknown, failed read, non-numeric) no longer
clears the fault: no false 'used again' INFO, no repeated WARNING, the status
row stays. Adds pv.has_reading(). DECISIONS wording fixed; tests added.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-10-16 18:19:44 +02:00
co-authored by Claude
parent f0b4e68e49
commit 7d52dc1c0f
4 changed files with 97 additions and 16 deletions
+3 -1
View File
@@ -3472,7 +3472,9 @@ class Controller:
# power: not used, as if the option were empty.
st = await self.hass.state(o["peak_forecast_entity"])
self.peak_fc, _why = pv_read.watts(st)
self._peak_fc_unit_log(pv_read.unit_fault(st))
# A missing reading leaves the unit-fault state as it was.
if pv_read.has_reading(st):
self._peak_fc_unit_log(pv_read.unit_fault(st))
else:
self.peak_fc = None
self._peak_fc_fault = None