]> git.basschouten.com Git - openhab-addons.git/commitdiff
[insteon] ignore commands if device is not online (#12787)
authorrobnielsen <rob.nielsen@yahoo.com>
Mon, 23 May 2022 19:56:35 +0000 (14:56 -0500)
committerGitHub <noreply@github.com>
Mon, 23 May 2022 19:56:35 +0000 (21:56 +0200)
Signed-off-by: Rob Nielsen <rob.nielsen@yahoo.com>
bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/handler/InsteonDeviceHandler.java

index 31ff0fa518fba27e3ad7441570f0f830924c7eaa..2baf82e04273784c36a0837da2b003415b0d0aef 100644 (file)
@@ -410,9 +410,14 @@ public class InsteonDeviceHandler extends BaseThingHandler {
 
     @Override
     public void handleCommand(ChannelUID channelUID, Command command) {
-        logger.debug("channel {} was triggered with the command {}", channelUID.getAsString(), command);
+        if (ThingStatus.ONLINE.equals(getThing().getStatus())) {
+            logger.debug("channel {} was triggered with the command {}", channelUID.getAsString(), command);
 
-        getInsteonBinding().sendCommand(channelUID.getAsString(), command);
+            getInsteonBinding().sendCommand(channelUID.getAsString(), command);
+        } else {
+            logger.debug("the command {} for channel {} was ignored because the thing is not ONLINE", command,
+                    channelUID.getAsString());
+        }
     }
 
     @Override