mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[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:
parent
2f808bc8dd
commit
2d53243de7
@ -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());
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user