Completing

Signed-off-by: gael@lhopital.org <gael@lhopital.org>
This commit is contained in:
gael@lhopital.org 2025-01-03 18:09:42 +01:00
parent 0ffc18a7f6
commit f0ce2fc9fe
2 changed files with 9 additions and 5 deletions

View File

@ -295,11 +295,14 @@ public class ApiBridgeHandler extends BaseBridgeHandler {
public synchronized <T> T executeUri(URI uri, HttpMethod method, Class<T> 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");

View File

@ -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 {