[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 <lg.hc@free.fr>
This commit is contained in:
parent
d83a036e1a
commit
1aeaccfe04
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue