diff --git a/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java b/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java index 3c25f325cf..5b1c9b2ff8 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java @@ -104,10 +104,8 @@ public class RuffyScripter { private volatile Command activeCmd = null; - // TODO take a callback to call when command finishes? - // TODO sometimes hangs ... we should timeout and raise an alert to check the pump and ruffy - // TODO not getting a menu update in a while is a good cue ... - // fire up a monitoring thread for that? + // TODO fire up a monitoring thread to intervene when we're stuck? re-bind service + // in case ruffy app went away public CommandResult runCommand(final Command cmd) { try { if (isPumpBusy()) { diff --git a/app/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java b/app/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java index 2550c121e5..9a13180855 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/commands/BolusCommand.java @@ -81,8 +81,7 @@ public class BolusCommand implements Command { private void verifyDisplayedBolusAmount(RuffyScripter scripter) { double displayedBolus = (double) scripter.currentMenu.getAttribute(MenuAttribute.BOLUS); log.debug("Final bolus: " + displayedBolus); - // TODO can't we just use BigDecimal? doubles aren't precise ... - if (Math.abs(displayedBolus - bolus) > 0.001) { + if (Math.abs(displayedBolus - bolus) > 0.05) { throw new CommandException().message("Failed to set correct bolus. Expected: " + bolus + ", actual: " + displayedBolus); } }