diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java
index e184426504..b6dfff171d 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java
@@ -473,10 +473,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
// start bolus delivery
bolusInProgress = true;
CommandResult bolusCmdResult = runCommand(null, 0,
- () -> {
- return ruffyScripter.deliverBolus(detailedBolusInfo.insulin,
- progressReporter);
- });
+ () -> ruffyScripter.deliverBolus(detailedBolusInfo.insulin, progressReporter));
bolusInProgress = false;
if (bolusCmdResult.success) {
@@ -543,7 +540,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
MainApp.getConfigBuilder().addToHistoryTreatment(detailedBolusInfo);
log.debug(String.format(Locale.getDefault(), "Added partial bolus of %.2f to treatments", lastBolus.amount));
return new PumpEnactResult().success(false).enacted(true)
- .comment(String.format(MainApp.sResources.getString(R.string.combo_error_partial_bolus_delivered),
+ .comment(MainApp.sResources.getString(R.string.combo_error_partial_bolus_delivered,
lastBolus.amount, detailedBolusInfo.insulin));
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 7b8bc94ef3..61a9abb50d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -813,7 +813,7 @@
Never
Requested operation not supported by pump
Unsafe usage: extended or multiwave boluses have been delivered within the last 6 hours or the selected basal rate is not 1. Loop mode has been set to low-suspend only until 6 hours after the last unsupported bolus or basal rate profile. Only normal boluses are supported in loop mode with basal rate profile 1.
- A bolus with the same amount was requested within the last minute. For safety reasons this is disallowed.
+ A bolus with the same amount was requested within the last minute. To prevent accidental double boluses and to guard against bugs this is disallowed.
Now
Reading pump history
pump history
diff --git a/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/RuffyCommands.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/RuffyCommands.java
index 93562009da..8e43771ac1 100644
--- a/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/RuffyCommands.java
+++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/RuffyCommands.java
@@ -23,7 +23,7 @@ public interface RuffyCommands {
/** Indicate of the pump is busy processing a command. */
boolean isPumpBusy();
- /** Whether there's an active BT connection to the pump. */
+ /** Whether there's usable connection to the pump. */
boolean isConnected();
void disconnect();
diff --git a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java
index 827284139b..d0d4709a4f 100644
--- a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java
+++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java
@@ -90,8 +90,8 @@ public class BolusCommand extends BaseCommand {
result.success = true;
return;
}
- SystemClock.sleep(10);
}
+ SystemClock.sleep(10);
}
// the bolus progress is displayed on the main menu
@@ -171,16 +171,15 @@ public class BolusCommand extends BaseCommand {
readReservoirLevelAndLastBolus.setScripter(scripter);
readReservoirLevelAndLastBolus.execute();
Bolus lastBolus = readReservoirLevelAndLastBolus.result.lastBolus;
- if (Math.abs(System.currentTimeMillis() - lastBolus.timestamp) >= 10 * 60 * 1000) {
+ if (lastBolus == null || Math.abs(System.currentTimeMillis() - lastBolus.timestamp) >= 10 * 60 * 1000) {
throw new CommandException("Unable to determine last bolus");
}
result.delivered = lastBolus.amount;
} else {
// bolus delivery completed successfully and completely
result.delivered = bolus;
+ bolusProgressReporter.report(DELIVERED, 100, bolus);
}
-
- bolusProgressReporter.report(DELIVERED, 100, bolus);
result.success = true;
}