]> git.basschouten.com Git - openhab-addons.git/commitdiff
[somfytahoma] Ignore disabled things (#12687)
authorlolodomo <lg.hc@free.fr>
Thu, 5 May 2022 18:13:59 +0000 (20:13 +0200)
committerGitHub <noreply@github.com>
Thu, 5 May 2022 18:13:59 +0000 (20:13 +0200)
* [somfytahoma] Ignore disabled things

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java

index 64203ffb6f14dfc241a955536b81d2ef3a9d9011..950146b52e4521f49e1ac52d8b68bda89a171448 100644 (file)
@@ -451,7 +451,7 @@ public class SomfyTahomaBridgeHandler extends BaseBridgeHandler {
         boolean needsUpdate = reconciliation;
 
         for (Thing th : getThing().getThings()) {
-            if (ThingStatus.ONLINE != th.getStatus()) {
+            if (th.isEnabled() && ThingStatus.ONLINE != th.getStatus()) {
                 needsUpdate = true;
             }
         }
@@ -519,7 +519,7 @@ public class SomfyTahomaBridgeHandler extends BaseBridgeHandler {
     private void processGatewayEvent(SomfyTahomaEvent event) {
         // update gateway status
         for (Thing th : getThing().getThings()) {
-            if (THING_TYPE_GATEWAY.equals(th.getThingTypeUID())) {
+            if (th.isEnabled() && THING_TYPE_GATEWAY.equals(th.getThingTypeUID())) {
                 SomfyTahomaGatewayHandler gatewayHandler = (SomfyTahomaGatewayHandler) th.getHandler();
                 if (gatewayHandler != null && gatewayHandler.getGateWayId().equals(event.getGatewayId())) {
                     gatewayHandler.refresh(STATUS);
@@ -567,7 +567,7 @@ public class SomfyTahomaBridgeHandler extends BaseBridgeHandler {
                 handler.updateThingChannels(states);
             }
         } else {
-            logger.debug("Thing handler is null, probably not bound thing.");
+            logger.debug("Thing is disabled or handler is null, probably not bound thing.");
         }
     }
 
@@ -588,6 +588,9 @@ public class SomfyTahomaBridgeHandler extends BaseBridgeHandler {
 
     private @Nullable Thing getThingByDeviceUrl(String deviceUrl) {
         for (Thing th : getThing().getThings()) {
+            if (!th.isEnabled()) {
+                continue;
+            }
             String url = (String) th.getConfiguration().get("url");
             if (deviceUrl.equals(url)) {
                 return th;