From 7639b1c3e5b4eaaac4422618238aa87e344a4591 Mon Sep 17 00:00:00 2001 From: lsiepel Date: Mon, 6 Jan 2025 21:56:13 +0100 Subject: [PATCH] Fix SAT errors (#18047) Signed-off-by: Leo Siepel --- .../digiplex/internal/DigiplexAreaConfiguration.java | 5 ++++- .../digiplex/internal/DigiplexBridgeConfiguration.java | 7 +++++-- .../digiplex/internal/handler/DigiplexBridgeHandler.java | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) 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; }