From 9b4f3f6e0e708e18fb93703d158e52c3a748369f Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Thu, 21 Jun 2018 22:58:15 +0200 Subject: [PATCH] Don't apply loop result if a bolus is in progress. While an SMB is rejected by the queue in this scenario, a temp basal would still be applied, so don't apply loop results if a bolus is progress or queued at this point. --- .../info/nightscout/androidaps/plugins/Loop/LoopPlugin.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java index c01cf0a641..480646ccfc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java @@ -46,6 +46,7 @@ import info.nightscout.androidaps.plugins.Loop.events.EventLoopUpdateGui; import info.nightscout.androidaps.plugins.Loop.events.EventNewOpenLoopNotification; import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.androidaps.queue.Callback; +import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.utils.FabricPrivacy; import info.nightscout.utils.NSUpload; import info.nightscout.utils.SP; @@ -332,7 +333,9 @@ public class LoopPlugin extends PluginBase { Constraint closedLoopEnabled = MainApp.getConstraintChecker().isClosedLoopAllowed(); if (closedLoopEnabled.value()) { - if (result.isChangeRequested()) { + if (result.isChangeRequested() + && !ConfigBuilderPlugin.getCommandQueue().bolusInQueue() + && !ConfigBuilderPlugin.getCommandQueue().isRunning(Command.CommandType.BOLUS)) { final PumpEnactResult waiting = new PumpEnactResult(); waiting.queued = true; if (resultAfterConstraints.tempBasalRequested)