From 80a959e3707b16d5e8a6e3fdf16cf1751712650f Mon Sep 17 00:00:00 2001 From: lolodomo Date: Thu, 5 May 2022 20:16:07 +0200 Subject: [PATCH] [openweathermap] Ignore disabled things (#12686) Signed-off-by: Laurent Garnier --- .../internal/handler/OpenWeatherMapAPIHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapAPIHandler.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapAPIHandler.java index 600c3bc2e..b3b39a042 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapAPIHandler.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapAPIHandler.java @@ -18,6 +18,7 @@ import java.util.List; import java.util.Set; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; @@ -153,7 +154,7 @@ public class OpenWeatherMapAPIHandler extends BaseBridgeHandler { private void determineBridgeStatus() { ThingStatus status = ThingStatus.ONLINE; - List childs = getThing().getThings(); + List childs = getThing().getThings().stream().filter(Thing::isEnabled).collect(Collectors.toList()); if (!childs.isEmpty()) { status = ThingStatus.OFFLINE; for (Thing thing : childs) { @@ -168,7 +169,7 @@ public class OpenWeatherMapAPIHandler extends BaseBridgeHandler { private void updateThings() { ThingStatus status = ThingStatus.ONLINE; - List childs = getThing().getThings(); + List childs = getThing().getThings().stream().filter(Thing::isEnabled).collect(Collectors.toList()); if (!childs.isEmpty()) { status = ThingStatus.OFFLINE; for (Thing thing : childs) {