Skip to content

Commit

Permalink
check if negativeSwitch is "on" and positiveSwitch is "off. If so: ju…
Browse files Browse the repository at this point in the history
…st (openhab#13152)

print a warning instead of throwing a exception

Signed-off-by: David Kumar <[email protected]>
  • Loading branch information
truidix authored Jul 21, 2022
1 parent 0577ee8 commit 831e7ec
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ void addSwitch(String day, String setpoint, int time) {
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 {
Expand Down

0 comments on commit 831e7ec

Please sign in to comment.