From 63afb7bd84ee6aa184d70916ca809289f17f63d6 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Fri, 24 Nov 2017 23:06:21 +0100 Subject: [PATCH] SetBasalProfileCommand: fix waiting for input scrolling to complete. --- .../jotomo/ruffyscripter/commands/SetBasalProfileCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalProfileCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalProfileCommand.java index 48b7595184..a5e42014b6 100644 --- a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalProfileCommand.java +++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalProfileCommand.java @@ -107,8 +107,8 @@ public class SetBasalProfileCommand extends BaseCommand { double displayedRate = scripter.readBlinkingValue(Double.class, MenuAttribute.BASAL_RATE); long timeout = System.currentTimeMillis() + 10 * 1000; while (timeout > System.currentTimeMillis() - && ((change > 0 && displayedRate < requestedRate) - || (change < 0 && displayedRate > requestedRate))) { + && ((change > 0 && requestedRate - displayedRate > 0.001) // displayedRate < requestedRate) + || (change < 0 && displayedRate - requestedRate > 0.001))) { //displayedRate > requestedRate))) { log.debug("Waiting for pump to process scrolling input for rate, current: " + displayedRate + ", desired: " + requestedRate + ", scrolling " + (change > 0 ? "up" : "down"));