From: robnielsen Date: Mon, 23 May 2022 19:56:35 +0000 (-0500) Subject: [insteon] ignore commands if device is not online (#12787) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=5b79e182897e48b56236c09a2fd5f8e14df01e6a;p=openhab-addons.git [insteon] ignore commands if device is not online (#12787) Signed-off-by: Rob Nielsen --- diff --git a/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/handler/InsteonDeviceHandler.java b/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/handler/InsteonDeviceHandler.java index 31ff0fa518..2baf82e042 100644 --- a/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/handler/InsteonDeviceHandler.java +++ b/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/handler/InsteonDeviceHandler.java @@ -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