diff --git a/app/src/main/java/de/jotomo/ruffyscripter/commands/PumpState.java b/app/src/main/java/de/jotomo/ruffyscripter/commands/PumpState.java index 767f22b19a..95a5aa2bbf 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/commands/PumpState.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/commands/PumpState.java @@ -11,7 +11,7 @@ public class PumpState { public int tbrPercent = -1; public int tbrRemainingDuration = -1; public boolean isErrorOrWarning = false; - public int errorCode = -1; + public String errorMsg; public PumpState tbrActive(boolean tbrActive) { this.tbrActive = tbrActive; @@ -33,8 +33,8 @@ public class PumpState { return this; } - public PumpState errorCode(int errorCode) { - this.errorCode = errorCode; + public PumpState errorMsg(String errorMsg) { + this.errorMsg = errorMsg; return this; } @@ -45,7 +45,7 @@ public class PumpState { ", tbrPercent=" + tbrPercent + ", tbrRemainingDuration=" + tbrRemainingDuration + ", isErrorOrWarning=" + isErrorOrWarning + - ", errorCode=" + errorCode + + ", errorMsg=" + errorMsg + ", timestamp=" + timestamp + '}'; } diff --git a/app/src/main/java/de/jotomo/ruffyscripter/commands/ReadStateCommand.java b/app/src/main/java/de/jotomo/ruffyscripter/commands/ReadStateCommand.java index ac77dee602..139e727aad 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/commands/ReadStateCommand.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/commands/ReadStateCommand.java @@ -29,7 +29,7 @@ public class ReadStateCommand implements Command { } } else if (displayedMenuType == MenuType.WARNING_OR_ERROR) { state.isErrorOrWarning = true; - state.errorCode = (int) displayedMenu.getAttribute(MenuAttribute.ERROR); + state.errorMsg = (String) displayedMenu.getAttribute(MenuAttribute.MESSAGE); } else { throw new CommandException().success(false).message("Neither MAIN_MENU nor WARNING_OR_ERROR is displayed, but " + displayedMenuType); }