*/
package org.openhab.binding.somneo.internal;
-import static org.openhab.binding.somneo.internal.SomneoBindingConstants.THING_TYPE_HF367X;
+import static org.openhab.binding.somneo.internal.SomneoBindingConstants.*;
import java.util.Set;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.openhab.core.io.net.http.HttpClientFactory;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.binding.BaseThingHandlerFactory;
private final SomneoPresetStateDescriptionProvider provider;
@Activate
- public SomneoHandlerFactory(@Reference SomneoPresetStateDescriptionProvider provider) {
+ public SomneoHandlerFactory(final @Reference HttpClientFactory httpClientFactory,
+ @Reference SomneoPresetStateDescriptionProvider provider) {
this.provider = provider;
- this.secureClient = new HttpClient(new SslContextFactory.Client(false));
- this.insecureClient = new HttpClient(new SslContextFactory.Client(true));
+ this.secureClient = httpClientFactory.createHttpClient(BINDING_ID + "-secure",
+ new SslContextFactory.Client(false));
+ this.insecureClient = httpClientFactory.createHttpClient(BINDING_ID + "-insecure",
+ new SslContextFactory.Client(true));
try {
this.secureClient.start();