From 4a69ea0c0bd35ed2ef3ac781280ce468e31137c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manfred=20Kr=C3=A4mer?= <46526724+mkmannmanny@users.noreply.github.com> Date: Wed, 25 Dec 2024 08:51:41 +0100 Subject: [PATCH] Update bundles/org.openhab.binding.tapocontrol/src/main/java/org/openhab/binding/tapocontrol/internal/devices/rf/smartswitch/TapoSmartSwitchHandler.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: lsiepel Signed-off-by: Manfred Krämer <46526724+mkmannmanny@users.noreply.github.com> --- .../devices/rf/smartswitch/TapoSmartSwitchHandler.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 {