diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexAreaConfiguration.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexAreaConfiguration.java index dc1cac2b9d9..66439c09d53 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexAreaConfiguration.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexAreaConfiguration.java @@ -12,12 +12,15 @@ */ package org.openhab.binding.digiplex.internal; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * The {@link DigiplexAreaConfiguration} class contains fields mapping area configuration parameters. * * @author Robert Michalak - Initial contribution */ +@NonNullByDefault public class DigiplexAreaConfiguration { - public int refreshPeriod; + public int refreshPeriod = 60; } diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexBridgeConfiguration.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexBridgeConfiguration.java index 1dbb85a6b15..f7575805287 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexBridgeConfiguration.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexBridgeConfiguration.java @@ -12,13 +12,16 @@ */ package org.openhab.binding.digiplex.internal; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * The {@link DigiplexBridgeConfiguration} class contains fields mapping bridge configuration parameters. * * @author Robert Michalak - Initial contribution */ +@NonNullByDefault public class DigiplexBridgeConfiguration { - public String port; - public int baudrate; + public String port = ""; + public int baudrate = 2400; } diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexBridgeHandler.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexBridgeHandler.java index 679fb19e4bf..53b24ce2349 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexBridgeHandler.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexBridgeHandler.java @@ -102,7 +102,7 @@ public class DigiplexBridgeHandler extends BaseBridgeHandler implements SerialPo @Override public void initialize() { config = getConfigAs(DigiplexBridgeConfiguration.class); - if (config.port == null) { + if (config.port.isBlank()) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.CONFIGURATION_ERROR, "Port must be set!"); return; }