From 31c409f6ce222423fcd537efdb83aa3daaab8895 Mon Sep 17 00:00:00 2001 From: Ciprian Pascu Date: Wed, 8 Jan 2025 19:59:36 +0200 Subject: [PATCH] [sbus] fix sat issues Signed-off-by: Ciprian Pascu --- .../org/openhab/binding/sbus/BindingConstants.java | 2 +- .../binding/sbus/handler/AbstractSbusHandler.java | 2 +- .../binding/sbus/handler/SbusBridgeHandler.java | 11 +++-------- .../binding/sbus/handler/SbusHandlerFactory.java | 2 +- .../openhab/binding/sbus/handler/SbusRgbwHandler.java | 2 +- .../org/openhab/binding/sbus/handler/SbusService.java | 4 +++- .../binding/sbus/handler/SbusSwitchHandler.java | 2 +- .../binding/sbus/handler/SbusTemperatureHandler.java | 2 +- .../binding/sbus/handler/config/SbusBridgeConfig.java | 2 +- .../sbus/handler/config/SbusChannelConfig.java | 2 +- .../binding/sbus/handler/config/SbusDeviceConfig.java | 2 +- .../sbus/handler/config/TemperatureChannelConfig.java | 2 +- .../binding/sbus/internal/SbusServiceImpl.java | 2 +- 13 files changed, 17 insertions(+), 20 deletions(-) diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/BindingConstants.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/BindingConstants.java index feecdb7185f..6df84e459bb 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/BindingConstants.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/BindingConstants.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/AbstractSbusHandler.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/AbstractSbusHandler.java index a4cb6ae8fd3..72cab1284e2 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/AbstractSbusHandler.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/AbstractSbusHandler.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusBridgeHandler.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusBridgeHandler.java index 2628fca882c..3d19e94ef09 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusBridgeHandler.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusBridgeHandler.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional @@ -15,7 +15,6 @@ package org.openhab.binding.sbus.handler; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.sbus.handler.config.SbusBridgeConfig; -import org.openhab.binding.sbus.internal.SbusServiceImpl; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.ThingStatus; @@ -70,12 +69,8 @@ public class SbusBridgeHandler extends BaseBridgeHandler { return; } - try { - ((SbusServiceImpl) service).initialize(config.host, config.port); - updateStatus(ThingStatus.ONLINE); - } catch (Exception e) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); - } + service.initialize(config.host, config.port); + updateStatus(ThingStatus.ONLINE); } catch (Exception e) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusHandlerFactory.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusHandlerFactory.java index 8ec3a6ca2c2..d7c9f8b635c 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusHandlerFactory.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusHandlerFactory.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusRgbwHandler.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusRgbwHandler.java index 8b4abadb750..d51d499650d 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusRgbwHandler.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusRgbwHandler.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusService.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusService.java index e481801acb4..96f5e62fa1d 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusService.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusService.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional @@ -83,4 +83,6 @@ public interface SbusService { * Closes the service and releases resources. */ void close(); + + void initialize(String host, int port); } diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusSwitchHandler.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusSwitchHandler.java index d4dc4285335..f854dec8929 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusSwitchHandler.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusSwitchHandler.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusTemperatureHandler.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusTemperatureHandler.java index 4abcfbb3d08..16f3681fb86 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusTemperatureHandler.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/SbusTemperatureHandler.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/SbusBridgeConfig.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/SbusBridgeConfig.java index f066a066676..f2153126416 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/SbusBridgeConfig.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/SbusBridgeConfig.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/SbusChannelConfig.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/SbusChannelConfig.java index c1ba76471a6..bf9a7a18a4b 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/SbusChannelConfig.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/SbusChannelConfig.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/SbusDeviceConfig.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/SbusDeviceConfig.java index f5d5c1d4ff2..9a2cfed75d7 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/SbusDeviceConfig.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/SbusDeviceConfig.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/TemperatureChannelConfig.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/TemperatureChannelConfig.java index 6fc01bae02c..d35fc3a223e 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/TemperatureChannelConfig.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/handler/config/TemperatureChannelConfig.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional diff --git a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/internal/SbusServiceImpl.java b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/internal/SbusServiceImpl.java index 824e4a9cbdd..9a32e8ee77b 100644 --- a/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/internal/SbusServiceImpl.java +++ b/bundles/org.openhab.binding.sbus/src/main/java/org/openhab/binding/sbus/internal/SbusServiceImpl.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2010-2025 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional