Change way of checking operating mode during bolus delivery

This commit is contained in:
TebbeUbben 2019-02-09 23:12:36 +01:00
parent 0b1e181662
commit a8a182dc9d

View file

@ -538,8 +538,9 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
detailedBolusInfo.pumpId = insightBolusID.id;
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, true);
while (true) {
fetchStatus();
OperatingMode operatingMode = connectionService.requestMessage(new GetOperatingModeMessage()).await().getOperatingMode();
if (operatingMode != OperatingMode.STARTED) break;
List<ActiveBolus> activeBoluses = connectionService.requestMessage(new GetActiveBolusesMessage()).await().getActiveBoluses();
ActiveBolus activeBolus = null;
for (ActiveBolus bolus : activeBoluses) {
if (bolus.getBolusID() == bolusID) {