From d3c23f6c33c2c161bd35841ad10ba796c9c8bb34 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 19 Feb 2018 10:44:15 +0100 Subject: [PATCH] allow to override zero base basal on combo --- .../ruffyscripter/commands/SetBasalProfileCommand.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffyscripter/commands/SetBasalProfileCommand.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffyscripter/commands/SetBasalProfileCommand.java index f959c17f36..f403c2a89b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffyscripter/commands/SetBasalProfileCommand.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ruffyscripter/commands/SetBasalProfileCommand.java @@ -80,7 +80,13 @@ public class SetBasalProfileCommand extends BaseCommand { double currentRate = scripter.readBlinkingValue(Double.class, MenuAttribute.BASAL_RATE); log.debug("Current rate: " + currentRate + ", requested: " + requestedRate); // the pump changes steps size from 0.01 to 0.05 when crossing 1.00 U - long steps = stepsToOne(currentRate) - stepsToOne(requestedRate); + long steps = 0; + if (currentRate == 0) { + // edge case of starting from 0.00; + steps = stepsToOne(0.05) - stepsToOne(requestedRate) + 1; + } else { + steps = stepsToOne(currentRate) - stepsToOne(requestedRate); + } if (steps == 0) { return 0; }