From 0e246aa313f94faccd6dba85ecc4cd88e19d8790 Mon Sep 17 00:00:00 2001 From: lolodomo Date: Mon, 13 Feb 2023 11:16:05 +0100 Subject: [PATCH] [lgwebos] Create WEB socket client using OH core method (#14382) Follow-up PR #14331 Signed-off-by: Laurent Garnier --- .../binding/lgwebos/internal/LGWebOSHandlerFactory.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSHandlerFactory.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSHandlerFactory.java index bf9d78808..c7a880496 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSHandlerFactory.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSHandlerFactory.java @@ -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; }