From 2b8b6828e5fbc566a8c231c82dea7f21856cbb09 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Wed, 25 Oct 2017 15:08:41 +0200 Subject: [PATCH] Cleanup. --- .../commands/CancelTbrCommand.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/CancelTbrCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/CancelTbrCommand.java index 1fcad0a3d1..32d82ea436 100644 --- a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/CancelTbrCommand.java +++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/CancelTbrCommand.java @@ -21,23 +21,18 @@ public class CancelTbrCommand extends BaseCommand { return Collections.emptyList(); } + @Override + public String reconnectAlarm() { + return "TBR CANCELLED"; + } + @Override public CommandResult execute() { try { scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU); PumpState pumpState = scripter.readPumpStateInternal(); if (!pumpState.tbrActive) { -// log.debug("active temp basal 90s ago: " + -// MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis() - 90 * 1000)); -// log.debug("active temp basal 60s ago: " + -// MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis() - 30 * 1000)); -// log.debug("active temp basal 30s ago: " + -// MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis() - 30 * 1000)); -// log.debug("active temp basal now:: " + -// MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis())); - // TODO keep checking logs to ensure this case only happens because CancelTbrCommand was called - // twice by AAPS - log.warn("No TBR active to cancel"); + log.debug("No TBR active to cancel"); return new CommandResult() .success(true) // Technically, nothing was enacted, but AAPS needs this to recover @@ -47,6 +42,7 @@ public class CancelTbrCommand extends BaseCommand { .enacted(true) .message("No TBR active"); } + log.debug("Cancelling active TBR of " + pumpState.tbrPercent + "% with " + pumpState.tbrRemainingDuration + " min remaining"); SetTbrCommand setTbrCommand = new SetTbrCommand(100, 0);