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

+3 -3
View File
@@ -8114,11 +8114,11 @@ abstract class AppLocalizations {
/// **'Low battery'**
String get notification_lowBatteryTitle;
/// Body of the low battery notification
/// Body of the low battery notification; deviceName is the connected radio's node name
///
/// In en, this message translates to:
/// **'Device battery is at {percent}%'**
String notification_lowBatteryBody(int percent);
/// **'{deviceName} battery is at {percent}%'**
String notification_lowBatteryBody(String deviceName, int percent);
/// No description provided for @notification_messagesCount.
///