diff --git a/bundles/org.openhab.binding.tapocontrol/src/main/java/org/openhab/binding/tapocontrol/internal/devices/rf/smartswitch/TapoSmartSwitchHandler.java b/bundles/org.openhab.binding.tapocontrol/src/main/java/org/openhab/binding/tapocontrol/internal/devices/rf/smartswitch/TapoSmartSwitchHandler.java index 79588e1d8c909..bde3026939a44 100644 --- a/bundles/org.openhab.binding.tapocontrol/src/main/java/org/openhab/binding/tapocontrol/internal/devices/rf/smartswitch/TapoSmartSwitchHandler.java +++ b/bundles/org.openhab.binding.tapocontrol/src/main/java/org/openhab/binding/tapocontrol/internal/devices/rf/smartswitch/TapoSmartSwitchHandler.java @@ -66,12 +66,8 @@ public void handleCommand(ChannelUID channelUID, Command command) { /* perform actions */ if (command instanceof RefreshType) { setDeviceData(); - } else if (command instanceof OnOffType) { - if (command == OnOffType.ON) { - deviceInfo.setDeviceOn(true); - } else { - deviceInfo.setDeviceOn(false); - } + } else if (command instanceof OnOffType onOffCommand) { + deviceInfo.setDeviceOn(OnOffType.ON.equals(onOffCommand)); hub.sendCommandToChild(deviceInfo); } else {