Skip to content

Commit

Permalink
[netatmo] Fix getActiveChildren (openhab#12830)
Browse files Browse the repository at this point in the history
Wait for the thing being initialized properly by the thing manager
before considering it as an active children

Fix openhab#12809

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo authored and psmedley committed Feb 23, 2023
1 parent 794f4dc commit 6741bb2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ default Optional<CommonInterface> getHomeHandler() {
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();
}
Expand Down

0 comments on commit 6741bb2

Please sign in to comment.