[openweathermap] Ignore disabled things (#12686)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
parent
fddfe4e75f
commit
80a959e370
@ -18,6 +18,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
@ -153,7 +154,7 @@ public class OpenWeatherMapAPIHandler extends BaseBridgeHandler {
|
|||||||
|
|
||||||
private void determineBridgeStatus() {
|
private void determineBridgeStatus() {
|
||||||
ThingStatus status = ThingStatus.ONLINE;
|
ThingStatus status = ThingStatus.ONLINE;
|
||||||
List<Thing> childs = getThing().getThings();
|
List<Thing> childs = getThing().getThings().stream().filter(Thing::isEnabled).collect(Collectors.toList());
|
||||||
if (!childs.isEmpty()) {
|
if (!childs.isEmpty()) {
|
||||||
status = ThingStatus.OFFLINE;
|
status = ThingStatus.OFFLINE;
|
||||||
for (Thing thing : childs) {
|
for (Thing thing : childs) {
|
||||||
@ -168,7 +169,7 @@ public class OpenWeatherMapAPIHandler extends BaseBridgeHandler {
|
|||||||
|
|
||||||
private void updateThings() {
|
private void updateThings() {
|
||||||
ThingStatus status = ThingStatus.ONLINE;
|
ThingStatus status = ThingStatus.ONLINE;
|
||||||
List<Thing> childs = getThing().getThings();
|
List<Thing> childs = getThing().getThings().stream().filter(Thing::isEnabled).collect(Collectors.toList());
|
||||||
if (!childs.isEmpty()) {
|
if (!childs.isEmpty()) {
|
||||||
status = ThingStatus.OFFLINE;
|
status = ThingStatus.OFFLINE;
|
||||||
for (Thing thing : childs) {
|
for (Thing thing : childs) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user