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>
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();
}