diff --git a/src/main/java/org/openhab/binding/openlicht/handler/AbstractSmartWatchHandler.java b/src/main/java/org/openhab/binding/openlicht/handler/AbstractSmartWatchHandler.java index 5fece8dd9aad3add3777b5e6857b351eda084f58..1369c672e224572aa2631e9341589c9759db1448 100644 --- a/src/main/java/org/openhab/binding/openlicht/handler/AbstractSmartWatchHandler.java +++ b/src/main/java/org/openhab/binding/openlicht/handler/AbstractSmartWatchHandler.java @@ -18,7 +18,6 @@ import java.nio.ByteBuffer; import java.nio.DoubleBuffer; import java.util.HashSet; import java.util.Set; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import org.eclipse.smarthome.core.library.types.DecimalType; @@ -41,8 +40,6 @@ public abstract class AbstractSmartWatchHandler extends AbstractMqttHandler { private static Set<String> seenUnsupportedCategories; - private static ScheduledExecutorService executor; - public AbstractSmartWatchHandler(Thing thing, ConfigurationHolder configurationHolder) { super(thing, configurationHolder); maybeSetupStatics(); @@ -55,7 +52,11 @@ public abstract class AbstractSmartWatchHandler extends AbstractMqttHandler { seenUnsupportedCategories.clear(); } }; - executor.scheduleAtFixedRate(command, 0, timeout, TimeUnit.SECONDS); + if (executor != null) { + executor.scheduleAtFixedRate(command, 0, timeout, TimeUnit.SECONDS); + } else { + logger.warn("Did not schedule reset thread for unsupported categories."); + } } }