Skip to content

Commit 045065f

Browse files
authored
[somfytahoma] force the gateway discovery if the LAN mode is not working (openhab#16751)
Signed-off-by: Ondrej Pecta <[email protected]>
1 parent 8c22ea2 commit 045065f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,15 @@ public synchronized void login() {
307307
isDevModeReady() ? "LAN mode" : cloudFallback ? "Cloud mode fallback" : "Cloud mode");
308308
} else {
309309
logger.debug("Events id error: {}", id);
310-
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
311-
"unable to register events");
310+
if (!thingConfig.isDevMode()) {
311+
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
312+
"unable to register events");
313+
} else {
314+
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
315+
"LAN mode is not properly configured");
316+
logger.debug("Forcing the gateway discovery");
317+
discoverGateway();
318+
}
312319
}
313320
}
314321
} catch (JsonSyntaxException e) {

0 commit comments

Comments
 (0)