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

+2 -2
View File
@@ -4739,8 +4739,8 @@ class AppLocalizationsIt extends AppLocalizations {
String get notification_lowBatteryTitle => 'Low battery';
@override
String notification_lowBatteryBody(int percent) {
return 'Device battery is at $percent%';
String notification_lowBatteryBody(String deviceName, int percent) {
return '$deviceName battery is at $percent%';
}
@override