]> git.basschouten.com Git - openhab-addons.git/commitdiff
[netatmo] Fix getActiveChildren (#12830)
authorlolodomo <lg.hc@free.fr>
Fri, 27 May 2022 17:47:13 +0000 (19:47 +0200)
committerGitHub <noreply@github.com>
Fri, 27 May 2022 17:47:13 +0000 (19:47 +0200)
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 <lg.hc@free.fr>
bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/CommonInterface.java

index adec7694db92ac5b7f93d7b1c7d4fa627013c92b..d620431126fcfdf1be32bf95eb62273e326efab4 100644 (file)
@@ -126,8 +126,10 @@ public interface CommonInterface {
     default List<CommonInterface> 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();
     }