[lgwebos] Create WEB socket client using OH core method (#14382)

Follow-up PR #14331

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2023-02-13 11:16:05 +01:00 committed by GitHub
parent b2a4ee42c9
commit 0e246aa313
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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;
}