From 00dae6f615de47e308712c7124d0f59f51fea131 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 --- .../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 995ef66cf2162..002ede5be0bb3 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 @@ -275,7 +275,7 @@ public Request createRequest(String url, HttpMethod method, @Nullable Object con logger.trace("Create request for http client {}", this.toString()); 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 48ab25ddaa1b0..f3bac8cd200ad 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 @@ -100,6 +100,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