[gardena] Fixed connection tracker (#13238)

* Removed provider header, no longer necessary
* Fixed connection tracker not starting after some websocket restarts

Signed-off-by: Gerhard Riegler <gerhard.riegler@gmail.com>
This commit is contained in:
Gerhard Riegler 2022-08-12 16:54:24 +02:00 committed by GitHub
parent 2f808bc8dd
commit 2d53243de7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -215,7 +215,6 @@ public class GardenaSmartImpl implements GardenaSmart, GardenaSmartWebSocketList
final PostOAuth2Response token = this.token;
if (token != null) {
request.header("Authorization", token.tokenType + " " + token.accessToken);
request.header("Authorization-provider", token.provider);
}
request.header("X-Api-Key", config.getApiKey());
}

View File

@ -121,11 +121,11 @@ public class GardenaSmartWebSocket {
ScheduledFuture<?> connectionTracker = this.connectionTracker;
if (connectionTracker != null && !connectionTracker.isCancelled()) {
connectionTracker.cancel(false);
connectionTracker.cancel(true);
}
// start sending PING every two minutes
this.connectionTracker = scheduler.scheduleWithFixedDelay(this::sendKeepAlivePing, 2, 2, TimeUnit.MINUTES);
this.connectionTracker = scheduler.scheduleWithFixedDelay(this::sendKeepAlivePing, 1, 2, TimeUnit.MINUTES);
}
@OnWebSocketFrame