[insteon] ignore commands if device is not online (#12787)

Signed-off-by: Rob Nielsen <rob.nielsen@yahoo.com>
pull/12793/head
robnielsen 2022-05-23 14:56:35 -05:00 committed by GitHub
parent 6a6cf3e515
commit 5b79e18289
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View 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