From 18d5fbfe7319a52a305b71a9af220959095391f5 Mon Sep 17 00:00:00 2001 From: David Pace Date: Sun, 11 Jun 2023 17:52:26 +0200 Subject: [PATCH] [boschshc] Upgrade to REST API version 3.2 (#15053) (#15067) closes #15053 Signed-off-by: David Pace Signed-off-by: Thomas Burri --- .../boschshc/internal/devices/bridge/BoschHttpClient.java | 2 +- .../boschshc/internal/devices/bridge/BoschHttpClientTest.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschHttpClient.java b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschHttpClient.java index 1e85509b77412..9d5393169766e 100644 --- a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschHttpClient.java +++ b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschHttpClient.java @@ -287,7 +287,7 @@ public Request createRequest(String url, HttpMethod method, @Nullable Object con logger.trace("Create request for http client {}", this); Request request = this.newRequest(url).method(method).header("Content-Type", "application/json") - .header("api-version", "2.1") // see https://github.com/BoschSmartHome/bosch-shc-api-docs/issues/46 + .header("api-version", "3.2") // see https://github.com/BoschSmartHome/bosch-shc-api-docs/issues/80 .timeout(10, TimeUnit.SECONDS); // Set default timeout if (content != null) { diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschHttpClientTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschHttpClientTest.java index 04f217d101500..5461b7eed8a2b 100644 --- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschHttpClientTest.java +++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschHttpClientTest.java @@ -160,6 +160,7 @@ void doPairing() throws InterruptedException { void createRequest() { Request request = httpClient.createRequest("https://127.0.0.1", HttpMethod.GET); assertNotNull(request); + assertEquals("3.2", request.getHeaders().get("api-version")); } @Test