From: David Pace Date: Sun, 11 Jun 2023 15:52:26 +0000 (+0200) Subject: [boschshc] Upgrade to REST API version 3.2 (#15053) (#15067) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=13a036e30db8938a60d460dcb5b192d4a8b67081;p=openhab-addons.git [boschshc] Upgrade to REST API version 3.2 (#15053) (#15067) closes #15053 Signed-off-by: David Pace --- 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 1e85509b77..9d53931697 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 class BoschHttpClient extends HttpClient { 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 04f217d101..5461b7eed8 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 @@ class BoschHttpClientTest { void createRequest() { Request request = httpClient.createRequest("https://127.0.0.1", HttpMethod.GET); assertNotNull(request); + assertEquals("3.2", request.getHeaders().get("api-version")); } @Test