Debounce MQTT disconnects, undo precautionary safe_state, make stale notifications informative

This commit is contained in:
Sterling Archer
2026-08-11 05:59:02 -07:00
parent 9cc47d9a8f
commit aeabae212a
2 changed files with 74 additions and 6 deletions
+12
View File
@@ -194,6 +194,18 @@ class NotificationSettings:
self.channels = list(channels or [])
self.template = str(raw.get("template") or DEFAULT_NOTIFY_TEMPLATE)
self.stale_template = str(
raw.get("stale_template")
or (
"{source_name}: telemetry lost ({reason}). Last seen battery "
"{battery_soc}% at {last_seen}. {target_name} was turned {action} "
"as a precaution."
)
)
self.recovered_template = str(
raw.get("recovered_template")
or "{source_name}: telemetry is back after {outage}. Rules resumed."
)
self.title = str(raw.get("title") or "{profile}")
self.throttle = parse_duration(
raw.get("throttle", DEFAULT_NOTIFY_THROTTLE), "notifications.throttle"