From cafa8fdcff63f6efd9301a413f800d21e98ca66a Mon Sep 17 00:00:00 2001 From: Ondrej Pecta Date: Wed, 23 Sep 2020 19:43:22 +0200 Subject: [PATCH] [somfytahoma] fixed detection of roller shutters (#8557) * [somfytahoma] fixed detection of roller shutters * [somfytahoma] got rid of compile warning Signed-off-by: Ondrej Pecta --- .../internal/discovery/SomfyTahomaItemDiscoveryService.java | 4 ++-- .../internal/handler/SomfyTahomaBaseThingHandler.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/discovery/SomfyTahomaItemDiscoveryService.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/discovery/SomfyTahomaItemDiscoveryService.java index 55615b06772..fd6b1b5d420 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/discovery/SomfyTahomaItemDiscoveryService.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/discovery/SomfyTahomaItemDiscoveryService.java @@ -343,11 +343,11 @@ public class SomfyTahomaItemDiscoveryService extends AbstractDiscoveryService } private boolean isSilentRollerShutter(SomfyTahomaDevice device) { - return hasCommmand(device, COMMAND_SET_CLOSURESPEED); + return "PositionableRollerShutterWithLowSpeedManagement".equals(device.getWidget()); } private boolean isUnoRollerShutter(SomfyTahomaDevice device) { - return hasState(device, TARGET_CLOSURE_STATE); + return "PositionableRollerShutterUno".equals(device.getWidget()); } private boolean isOnOffHeatingSystem(SomfyTahomaDevice device) { diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java index 10da828b38c..1f12dc80951 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java @@ -96,7 +96,8 @@ public abstract class SomfyTahomaBaseThingHandler extends BaseThingHandler { } protected @Nullable SomfyTahomaBridgeHandler getBridgeHandler() { - return this.getBridge() != null ? (SomfyTahomaBridgeHandler) this.getBridge().getHandler() : null; + Bridge localBridge = this.getBridge(); + return localBridge != null ? (SomfyTahomaBridgeHandler) localBridge.getHandler() : null; } private String getURL() {