diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/ApiBridgeHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/ApiBridgeHandler.java index 128adeaabdd..d268551b708 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/ApiBridgeHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/ApiBridgeHandler.java @@ -295,11 +295,14 @@ public class ApiBridgeHandler extends BaseBridgeHandler { public synchronized T executeUri(URI uri, HttpMethod method, Class clazz, @Nullable String payload, @Nullable String contentType, int retryCount) throws NetatmoException { + if (connectJob.isPresent()) { + throw new NetatmoException("Connection pending, request will not be accepted in the meantime."); + } + + logger.debug("executeUri {} {} ", method.toString(), uri); + Request request = httpClient.newRequest(uri).method(method).timeout(TIMEOUT_S, TimeUnit.SECONDS); + try { - logger.debug("executeUri {} {} ", method.toString(), uri); - - Request request = httpClient.newRequest(uri).method(method).timeout(TIMEOUT_S, TimeUnit.SECONDS); - if (!authenticate(null, null)) { prepareReconnection(getConfiguration().reconnectInterval, "@text/status-bridge-offline", null, null); throw new NetatmoException("Not authenticated"); diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/capability/RefreshCapability.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/capability/RefreshCapability.java index de1d2ff4a46..adee890d330 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/capability/RefreshCapability.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/capability/RefreshCapability.java @@ -91,9 +91,10 @@ public class RefreshCapability extends Capability { && !ThingStatus.ONLINE.equals(accountHandler.getThing().getStatus())) { delay = accountHandler.getTimeBeforeReconnect(); delay = delay != null ? delay.plus(ASAP) : OFFLINE_DELAY; + logger.debug("Bridge is not ONLINE, will wait for him to come-back {}", thingUID, delay); } else { delay = OFFLINE_DELAY; - logger.debug("Thing '{}' is not ONLINE, special refresh interval {} used", thingUID, OFFLINE_DELAY); + logger.debug("Thing '{}' is not ONLINE, special refresh interval {} used", thingUID, delay); } } else {