SAFETY-118: a missing peak forecast reading keeps the unit-fault state
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:
co-authored by
Claude
parent
f0b4e68e49
commit
7d52dc1c0f
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user