]> git.basschouten.com Git - openhab-addons.git/commitdiff
[lgwebos] Create WEB socket client using OH core method (#14382)
authorlolodomo <lg.hc@free.fr>
Mon, 13 Feb 2023 10:16:05 +0000 (11:16 +0100)
committerGitHub <noreply@github.com>
Mon, 13 Feb 2023 10:16:05 +0000 (11:16 +0100)
Follow-up PR #14331

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSHandlerFactory.java

index bf9d788088d881da3eb3ebe675c55f149fe54dac..c7a88049635c6199e0cb95bf36da94a506f2e30e 100644 (file)
@@ -16,7 +16,6 @@ import static org.openhab.binding.lgwebos.internal.LGWebOSBindingConstants.*;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.jetty.client.HttpClient;
 import org.eclipse.jetty.util.ssl.SslContextFactory;
 import org.eclipse.jetty.websocket.client.WebSocketClient;
 import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler;
@@ -55,8 +54,7 @@ public class LGWebOSHandlerFactory extends BaseThingHandlerFactory {
          * Cannot use openHAB's shared web socket client (webSocketFactory.getCommonWebSocketClient()) as we have to
          * change client settings.
          */
-        var httpClient = new HttpClient(new SslContextFactory.Client(true));
-        this.webSocketClient = new WebSocketClient(httpClient);
+        this.webSocketClient = webSocketFactory.createWebSocketClient(BINDING_ID, new SslContextFactory.Client(true));
         this.stateDescriptionProvider = stateDescriptionProvider;
     }