From 4ac5dd40b1def6f6375051d35d03f9ddc610797f Mon Sep 17 00:00:00 2001 From: Ondrej Pecta Date: Sun, 19 May 2024 13:31:14 +0200 Subject: [PATCH] [somfytahoma] force the gateway discovery if the LAN mode is not working (#16751) Signed-off-by: Ondrej Pecta Signed-off-by: Ciprian Pascu --- .../internal/handler/SomfyTahomaBridgeHandler.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java index 0b1a79dce15..babfd7ca92f 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java @@ -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) {