From bb2e885b95a57e6536f5f14015020d980f8e60e7 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Wed, 22 Nov 2017 00:38:10 +0100 Subject: [PATCH] RuffyScripter: fix pump state check before running command. --- .../java/de/jotomo/ruffyscripter/RuffyScripter.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java index 1e7b0b3b06..d0e49f67c8 100644 --- a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java +++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java @@ -257,10 +257,12 @@ public class RuffyScripter implements RuffyCommands { if (cmd instanceof ReadPumpStateCommand) { // always allowed, state is set at the end of runCommand method activeCmd.getResult().success = true; - } else if (getCurrentMenu().getType() == MenuType.STOP && cmd.needsRunMode()) { - log.error("Requested command requires run mode, but pump is suspended"); - activeCmd.getResult().success = false; - return; + } else if (getCurrentMenu().getType() == MenuType.STOP) { + if (cmd.needsRunMode()) { + log.error("Requested command requires run mode, but pump is suspended"); + activeCmd.getResult().success = false; + return; + } } else if (getCurrentMenu().getType() == MenuType.WARNING_OR_ERROR && !(cmd instanceof ConfirmAlertCommand)) { log.warn("Warning/alert active on pump, but requested command is not ConfirmAlertCommand"); activeCmd.getResult().success = false;