]> git.basschouten.com Git - openhab-addons.git/commitdiff
check if negativeSwitch is "on" and positiveSwitch is "off. If so: just (#13152)
authortruidix <49732750+truidix@users.noreply.github.com>
Thu, 21 Jul 2022 19:31:02 +0000 (21:31 +0200)
committerGitHub <noreply@github.com>
Thu, 21 Jul 2022 19:31:02 +0000 (21:31 +0200)
print a warning instead of throwing a exception

Signed-off-by: David Kumar <git@truidix.de>
bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200SwitchProgramServiceHandler.java

index cfd5cad9021914853abd6b2b090b6c88b4019b73..9a16145ad2a8b7f872e08c3a307588b635064928 100644 (file)
@@ -101,7 +101,8 @@ public class KM200SwitchProgramServiceHandler {
         if (!setpoints.contains(setpoint)) {
             if (setpoints.size() == 2 && "on".compareTo(setpoint) == 0) {
                 if ("high".compareTo(setpoints.get(0)) == 0 && "off".compareTo(setpoints.get(1)) == 0) {
-                    if ("on".compareTo(positiveSwitch) == 0 && "off".compareTo(negativeSwitch) == 0) {
+                    if (("on".compareTo(positiveSwitch) == 0 && "off".compareTo(negativeSwitch) == 0)
+                            || ("off".compareTo(positiveSwitch) == 0 && "on".compareTo(negativeSwitch) == 0)) {
                         logger.info(
                                 "!!! Wrong configuration on device. 'on' instead of 'high' in switch program. It seems that's a firmware problem-> ignoring it !!!");
                     } else {