189 files

This commit is contained in:
Home Assistant Version Control
2026-09-08 18:05:32 +00:00
parent 79fefc0a7c
commit 303886f212
189 changed files with 21402 additions and 3514 deletions
@@ -247,6 +247,13 @@ class MaintenanceSensor(MaintenanceEntity, SensorEntity):
"priority": task.get("priority") or DEFAULT_TASK_PRIORITY,
}
# Recorded readings (#83 / #161 phase 2): the newest completion's
# value(s) — stable between completions, so templates can read a
# meter without parsing history. Only present once a value exists.
from .helpers.reading_slots import last_reading_attributes
attrs.update(last_reading_attributes(task.get("history")))
# Task phases (#139): which cycle step is due — stable (changes once
# per completion), so it belongs on the entity for automations
# ("announce 'replace blades' only when THAT phase comes up").
@@ -851,7 +858,10 @@ class BatteryFleetLowSensor(SensorEntity):
sticky.pop(eid, None) # gone from the fleet
continue
level = current.get("level")
if level is not None and float(level) >= sticky[eid] + self._HYSTERESIS_PERCENT:
# A sensorless note (D#162) has no level to hover — it leaves
# `low` only when its forecast re-anchors (or the option is
# switched off), and that is the real all-clear.
if current.get("no_sensor") or (level is not None and float(level) >= sticky[eid] + self._HYSTERESIS_PERCENT):
sticky.pop(eid, None)
return len(low_ids | set(sticky))