]> git.basschouten.com Git - openhab-addons.git/commitdiff
[systeminfo] Use the existing ChannelUID instance to check the linked state (#16553)
authorjoerg1985 <16140691+joerg1985@users.noreply.github.com>
Thu, 21 Mar 2024 21:15:34 +0000 (22:15 +0100)
committerGitHub <noreply@github.com>
Thu, 21 Mar 2024 21:15:34 +0000 (22:15 +0100)
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/handler/SysteminfoHandler.java

index 3454ee999fe0c6521030f60fe1421b05d98cbd7b..eb6fccc30c205fa27c327fc39e5834782b31c49c 100644 (file)
@@ -18,7 +18,6 @@ import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -403,10 +402,8 @@ public class SysteminfoHandler extends BaseThingHandler {
         if (!ThingStatus.ONLINE.equals(thing.getStatus())) {
             return;
         }
-        Iterator<ChannelUID> iter = channels.iterator();
-        while (iter.hasNext()) {
-            ChannelUID channeUID = iter.next();
-            if (isLinked(channeUID.getId())) {
+        for (ChannelUID channeUID : channels) {
+            if (isLinked(channeUID)) {
                 publishDataForChannel(channeUID);
             }
         }