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:
1 parent
7d55bf03df
commit
b6c1d73bf0
22 files changed
+138
-52
No files matched your search
+5
-2
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
///
|
||||
|
||||
@@ -4731,8 +4731,8 @@ class AppLocalizationsBg 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
|
||||
|
||||
@@ -4742,8 +4742,8 @@ class AppLocalizationsDe 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
|
||||
|
||||
@@ -4666,8 +4666,8 @@ class AppLocalizationsEn 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
|
||||
|
||||
@@ -4733,8 +4733,8 @@ class AppLocalizationsEs 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
|
||||
|
||||
@@ -4752,8 +4752,8 @@ class AppLocalizationsFr 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
|
||||
|
||||
@@ -4730,8 +4730,8 @@ class AppLocalizationsHu 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4502,8 +4502,8 @@ class AppLocalizationsJa 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
|
||||
|
||||
@@ -4513,8 +4513,8 @@ class AppLocalizationsKo 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
|
||||
|
||||
@@ -4708,8 +4708,8 @@ class AppLocalizationsNl 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
|
||||
|
||||
@@ -4759,8 +4759,8 @@ class AppLocalizationsPl 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
|
||||
|
||||
@@ -4735,8 +4735,8 @@ class AppLocalizationsPt 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
|
||||
|
||||
@@ -4743,8 +4743,8 @@ class AppLocalizationsRu 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
|
||||
|
||||
@@ -4716,8 +4716,8 @@ class AppLocalizationsSk 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
|
||||
|
||||
@@ -4714,8 +4714,8 @@ class AppLocalizationsSl 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
|
||||
|
||||
@@ -4690,8 +4690,8 @@ class AppLocalizationsSv 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
|
||||
|
||||
@@ -4742,8 +4742,8 @@ class AppLocalizationsUk 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
|
||||
|
||||
@@ -4410,8 +4410,8 @@ class AppLocalizationsZh 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
|
||||
|
||||
Reference in new issue
Block a user