mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 07:02:02 +01:00
parent
0ffc18a7f6
commit
f0ce2fc9fe
@ -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");
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user