From: lolodomo Date: Mon, 13 Feb 2023 10:16:05 +0000 (+0100) Subject: [lgwebos] Create WEB socket client using OH core method (#14382) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=0e246aa313f94faccd6dba85ecc4cd88e19d8790;p=openhab-addons.git [lgwebos] Create WEB socket client using OH core method (#14382) Follow-up PR #14331 Signed-off-by: Laurent Garnier --- 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 bf9d788088..c7a8804963 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; }