[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() {
|
default List<CommonInterface> getActiveChildren() {
|
||||||
Thing thing = getThing();
|
Thing thing = getThing();
|
||||||
if (thing instanceof Bridge) {
|
if (thing instanceof Bridge) {
|
||||||
return ((Bridge) thing).getThings().stream().filter(Thing::isEnabled).map(Thing::getHandler)
|
return ((Bridge) thing).getThings().stream().filter(Thing::isEnabled)
|
||||||
.filter(Objects::nonNull).map(CommonInterface.class::cast).collect(Collectors.toList());
|
.filter(th -> th.getStatusInfo().getStatusDetail() != ThingStatusDetail.BRIDGE_OFFLINE)
|
||||||
|
.map(Thing::getHandler).filter(Objects::nonNull).map(CommonInterface.class::cast)
|
||||||
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
return List.of();
|
return List.of();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user