Add extra check

This commit is contained in:
Bart Sopers 2020-11-12 20:29:52 +01:00
parent e9944e3b9c
commit 103333dee1

View file

@ -247,6 +247,7 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
if (podStateManager.hasPodState()) { if (podStateManager.hasPodState()) {
AlertSet activeAlerts = podStateManager.getActiveAlerts(); AlertSet activeAlerts = podStateManager.getActiveAlerts();
if (activeAlerts != null) {
if (aapsOmnipodManager.isAutomaticallyAcknowledgeAlertsEnabled() && activeAlerts.size() > 0 && !getCommandQueue().isCustomCommandInQueue(CommandAcknowledgeAlerts.class)) { if (aapsOmnipodManager.isAutomaticallyAcknowledgeAlertsEnabled() && activeAlerts.size() > 0 && !getCommandQueue().isCustomCommandInQueue(CommandAcknowledgeAlerts.class)) {
String alerts = TextUtils.join(", ", aapsOmnipodUtil.getTranslatedActiveAlerts(podStateManager)); String alerts = TextUtils.join(", ", aapsOmnipodUtil.getTranslatedActiveAlerts(podStateManager));
getCommandQueue().customCommand(new CommandAcknowledgeAlerts(), new Callback() { getCommandQueue().customCommand(new CommandAcknowledgeAlerts(), new Callback() {
@ -262,6 +263,7 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
}); });
} }
} }
}
doPodCheck(); doPodCheck();