]> git.basschouten.com Git - openhab-addons.git/commitdiff
[openweathermap] Ignore disabled things (#12686)
authorlolodomo <lg.hc@free.fr>
Thu, 5 May 2022 18:16:07 +0000 (20:16 +0200)
committerGitHub <noreply@github.com>
Thu, 5 May 2022 18:16:07 +0000 (20:16 +0200)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapAPIHandler.java

index 600c3bc2e9bc3df6ac9751e6b7cd565d38ee98a3..b3b39a04276c40bd29419bb88fe5c8e6f6431fa9 100644 (file)
@@ -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<Thing> childs = getThing().getThings();
+        List<Thing> 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<Thing> childs = getThing().getThings();
+        List<Thing> childs = getThing().getThings().stream().filter(Thing::isEnabled).collect(Collectors.toList());
         if (!childs.isEmpty()) {
             status = ThingStatus.OFFLINE;
             for (Thing thing : childs) {