From 1aeaccfe04d3a44024822586fef8607b3ca0b3bf Mon Sep 17 00:00:00 2001 From: lolodomo Date: Fri, 27 May 2022 19:47:13 +0200 Subject: [PATCH] [netatmo] Fix getActiveChildren (#12830) Wait for the thing being initialized properly by the thing manager before considering it as an active children Fix #12809 Signed-off-by: Laurent Garnier --- .../binding/netatmo/internal/handler/CommonInterface.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/CommonInterface.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/CommonInterface.java index adec7694d..d62043112 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/CommonInterface.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/CommonInterface.java @@ -126,8 +126,10 @@ public interface CommonInterface { default List getActiveChildren() { Thing thing = getThing(); if (thing instanceof Bridge) { - return ((Bridge) thing).getThings().stream().filter(Thing::isEnabled).map(Thing::getHandler) - .filter(Objects::nonNull).map(CommonInterface.class::cast).collect(Collectors.toList()); + return ((Bridge) thing).getThings().stream().filter(Thing::isEnabled) + .filter(th -> th.getStatusInfo().getStatusDetail() != ThingStatusDetail.BRIDGE_OFFLINE) + .map(Thing::getHandler).filter(Objects::nonNull).map(CommonInterface.class::cast) + .collect(Collectors.toList()); } return List.of(); }