]> git.basschouten.com Git - openhab-addons.git/commitdiff
[somfytahoma] force the gateway discovery if the LAN mode is not working (#16751)
authorOndrej Pecta <opecta@gmail.com>
Sun, 19 May 2024 11:31:14 +0000 (13:31 +0200)
committerGitHub <noreply@github.com>
Sun, 19 May 2024 11:31:14 +0000 (13:31 +0200)
Signed-off-by: Ondrej Pecta <opecta@gmail.com>
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java

index 0b1a79dce151f8a7fa9cb3be8d227ed5a6534950..babfd7ca92f17229a279a2f39b5448aa616607a4 100644 (file)
@@ -307,8 +307,15 @@ public class SomfyTahomaBridgeHandler extends BaseBridgeHandler {
                             isDevModeReady() ? "LAN mode" : cloudFallback ? "Cloud mode fallback" : "Cloud mode");
                 } else {
                     logger.debug("Events id error: {}", id);
-                    updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
-                            "unable to register events");
+                    if (!thingConfig.isDevMode()) {
+                        updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
+                                "unable to register events");
+                    } else {
+                        updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
+                                "LAN mode is not properly configured");
+                        logger.debug("Forcing the gateway discovery");
+                        discoverGateway();
+                    }
                 }
             }
         } catch (JsonSyntaxException e) {