]> git.basschouten.com Git - openhab-addons.git/commitdiff
[somfytahoma] Call createHttpClient with a SslContextFactory parameter (#14467)
authorlolodomo <lg.hc@free.fr>
Mon, 20 Feb 2023 19:33:56 +0000 (20:33 +0100)
committerGitHub <noreply@github.com>
Mon, 20 Feb 2023 19:33:56 +0000 (20:33 +0100)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java

index cd95c41ea9aa4d075cede205ca61dc2aca461411..638b8383d081b25a88270ddba0a2bfa9d6ac83f8 100644 (file)
@@ -73,6 +73,7 @@ import org.openhab.core.thing.ThingStatusDetail;
 import org.openhab.core.thing.ThingStatusInfo;
 import org.openhab.core.thing.binding.BaseBridgeHandler;
 import org.openhab.core.thing.binding.ThingHandlerService;
+import org.openhab.core.thing.util.ThingWebClientUtil;
 import org.openhab.core.types.Command;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -184,10 +185,11 @@ public class SomfyTahomaBridgeHandler extends BaseBridgeHandler {
 
     private void createHttpClient() {
         // let's create the right http client
+        String clientName = ThingWebClientUtil.buildWebClientConsumerName(thing.getUID(), null);
         if (thingConfig.isDevMode()) {
-            this.httpClient = new HttpClient(new SslContextFactory.Client(true));
+            this.httpClient = httpClientFactory.createHttpClient(clientName, new SslContextFactory.Client(true));
         } else {
-            this.httpClient = httpClientFactory.createHttpClient("somfy_" + thing.getUID().getId());
+            this.httpClient = httpClientFactory.createHttpClient(clientName);
         }
 
         try {