diff --git a/bundles/org.openhab.binding.somneo/src/main/java/org/openhab/binding/somneo/internal/SomneoBindingConstants.java b/bundles/org.openhab.binding.somneo/src/main/java/org/openhab/binding/somneo/internal/SomneoBindingConstants.java index 7f7e66a2a14..4317f530161 100644 --- a/bundles/org.openhab.binding.somneo/src/main/java/org/openhab/binding/somneo/internal/SomneoBindingConstants.java +++ b/bundles/org.openhab.binding.somneo/src/main/java/org/openhab/binding/somneo/internal/SomneoBindingConstants.java @@ -24,7 +24,7 @@ import org.openhab.core.thing.ThingTypeUID; @NonNullByDefault public class SomneoBindingConstants { - private static final String BINDING_ID = "somneo"; + public static final String BINDING_ID = "somneo"; // List of all Thing properties public static final String PROPERTY_VENDOR_NAME = "Philips"; diff --git a/bundles/org.openhab.binding.somneo/src/main/java/org/openhab/binding/somneo/internal/SomneoHandlerFactory.java b/bundles/org.openhab.binding.somneo/src/main/java/org/openhab/binding/somneo/internal/SomneoHandlerFactory.java index d7bbdd3fd95..17f8eda306f 100644 --- a/bundles/org.openhab.binding.somneo/src/main/java/org/openhab/binding/somneo/internal/SomneoHandlerFactory.java +++ b/bundles/org.openhab.binding.somneo/src/main/java/org/openhab/binding/somneo/internal/SomneoHandlerFactory.java @@ -12,7 +12,7 @@ */ 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; @@ -20,6 +20,7 @@ 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.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; @@ -50,11 +51,14 @@ public class SomneoHandlerFactory extends BaseThingHandlerFactory implements Htt 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();