From 2d53243de7e0f7d1fecffa894ea265b5f28ab25d Mon Sep 17 00:00:00 2001 From: Gerhard Riegler <6545044+gerrieg@users.noreply.github.com> Date: Fri, 12 Aug 2022 16:54:24 +0200 Subject: [PATCH] [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 --- .../openhab/binding/gardena/internal/GardenaSmartImpl.java | 1 - .../binding/gardena/internal/GardenaSmartWebSocket.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartImpl.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartImpl.java index d0340f5e06e..2d9ba66f37d 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartImpl.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartImpl.java @@ -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()); } diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartWebSocket.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartWebSocket.java index f9ec261af6f..f83fb06353d 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartWebSocket.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartWebSocket.java @@ -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