[homeconnect] Ignore disabled things (#12685)

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2022-05-05 20:15:04 +02:00 committed by GitHub
parent b4945f647c
commit fddfe4e75f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -245,13 +245,13 @@ public class HomeConnectBridgeHandler extends BaseBridgeHandler {
}
/**
* Get children of bridge
* Get children of bridge (disabled things are ignored)
*
* @return list of child handlers
*/
public List<AbstractHomeConnectThingHandler> getThingHandler() {
return getThing().getThings().stream()
.filter(thing -> thing.getHandler() instanceof AbstractHomeConnectThingHandler)
.filter(thing -> thing.isEnabled() && thing.getHandler() instanceof AbstractHomeConnectThingHandler)
.map(thing -> (AbstractHomeConnectThingHandler) thing.getHandler()).collect(Collectors.toList());
}