Fix review findings in low battery alerts

- Respect the notifications-enabled setting
- Notify only the lowest newly crossed threshold
- Ignore implausible readings (boards without a battery sensor report 0 mV)
- Wait for the device identity so the saved chemistry is used
- Require two consecutive low readings before alerting
- Re-arm and clear alerts on any link reset, not just explicit disconnect
- Cancel stale notifications on re-arm and link reset
- Scope notification ids per device and name the device in the body
- Use the connector's shared NotificationService
This commit is contained in:
zjs81 committed 2026-10-24 20:45:14 -07:00
1 parent 7d55bf03df
commit b6c1d73bf0
22 files changed
+138 -52

No files matched your search

+5 -2
View File
@@ -2682,10 +2682,13 @@
"@notification_lowBatteryTitle": {
"description": "Title of the low battery notification"
},
"notification_lowBatteryBody": "Device battery is at {percent}%",
"notification_lowBatteryBody": "{deviceName} battery is at {percent}%",
"@notification_lowBatteryBody": {
"description": "Body of the low battery notification",
"description": "Body of the low battery notification; deviceName is the connected radio's node name",
"placeholders": {
"deviceName": {
"type": "String"
},
"percent": {
"type": "int"
}