added low battery message

This commit is contained in:
minacode
2022-10-03 12:15:37 +02:00
committed by JF
parent 29673892c2
commit ccc8cee07a
4 changed files with 19 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ namespace Pinetime {
StopRinging,
MeasureBatteryTimerExpired,
BatteryPercentageUpdated,
LowBattery,
StartFileTransfer,
StopFileTransfer,
BleRadioEnableToggle

View File

@@ -424,6 +424,17 @@ void SystemTask::Work() {
case Messages::BatteryPercentageUpdated:
nimbleController.NotifyBatteryLevel(batteryController.PercentRemaining());
break;
case Messages::LowBattery:
{
Pinetime::Controllers::NotificationManager::Notification notif;
std::array<char, 101> message {"Low Battery\0Low Battery\0"};
notif.message = message;
notif.size = 25;
notif.category = Pinetime::Controllers::NotificationManager::Categories::SimpleAlert;
notificationManager.Push(std::move(notif));
PushMessage(Messages::OnNewNotification);
}
break;
case Messages::OnPairing:
if (state == SystemTaskState::Sleeping) {
GoToRunning();