From 8337f8b92d6156ea859f0c099ee53934f698b63e Mon Sep 17 00:00:00 2001 From: jlaur Date: Sat, 23 Oct 2021 00:05:16 +0200 Subject: [PATCH] [unifi] Fix thing configuration reload after changes (#11411) * Fix config reload after changes. Fixes #11407 Signed-off-by: Jacob Laursen * Don't try to initialize client when bridge is offline. Signed-off-by: Jacob Laursen --- .../internal/handler/UniFiBaseThingHandler.java | 1 + .../handler/UniFiClientThingHandler.java | 16 +++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiBaseThingHandler.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiBaseThingHandler.java index cf57ec332..69b6f8404 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiBaseThingHandler.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiBaseThingHandler.java @@ -59,6 +59,7 @@ public abstract class UniFiBaseThingHandler extends BaseThingHandler { } if (bridge.getStatus() == OFFLINE) { updateStatus(OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, "The UniFi Controller is currently offline."); + return; } // mgb: derive the config class from the generic type Class clazz = (Class) (((ParameterizedType) getClass().getGenericSuperclass()) diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiClientThingHandler.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiClientThingHandler.java index 139e031fb..9ceaf35ba 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiClientThingHandler.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiClientThingHandler.java @@ -69,16 +69,14 @@ public class UniFiClientThingHandler extends UniFiBaseThingHandler