RuffyScripter: fix pump state check before running command.
This commit is contained in:
parent
28b80697f9
commit
bb2e885b95
|
@ -257,10 +257,12 @@ public class RuffyScripter implements RuffyCommands {
|
||||||
if (cmd instanceof ReadPumpStateCommand) {
|
if (cmd instanceof ReadPumpStateCommand) {
|
||||||
// always allowed, state is set at the end of runCommand method
|
// always allowed, state is set at the end of runCommand method
|
||||||
activeCmd.getResult().success = true;
|
activeCmd.getResult().success = true;
|
||||||
} else if (getCurrentMenu().getType() == MenuType.STOP && cmd.needsRunMode()) {
|
} else if (getCurrentMenu().getType() == MenuType.STOP) {
|
||||||
log.error("Requested command requires run mode, but pump is suspended");
|
if (cmd.needsRunMode()) {
|
||||||
activeCmd.getResult().success = false;
|
log.error("Requested command requires run mode, but pump is suspended");
|
||||||
return;
|
activeCmd.getResult().success = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else if (getCurrentMenu().getType() == MenuType.WARNING_OR_ERROR && !(cmd instanceof ConfirmAlertCommand)) {
|
} else if (getCurrentMenu().getType() == MenuType.WARNING_OR_ERROR && !(cmd instanceof ConfirmAlertCommand)) {
|
||||||
log.warn("Warning/alert active on pump, but requested command is not ConfirmAlertCommand");
|
log.warn("Warning/alert active on pump, but requested command is not ConfirmAlertCommand");
|
||||||
activeCmd.getResult().success = false;
|
activeCmd.getResult().success = false;
|
||||||
|
|
Loading…
Reference in a new issue