]> git.basschouten.com Git - openhab-addons.git/commitdiff
[samsungtv] fix input change bug (#16787)
authorNick Waterton <NickWaterton@users.noreply.github.com>
Wed, 22 May 2024 20:45:00 +0000 (17:45 -0300)
committerGitHub <noreply@github.com>
Wed, 22 May 2024 20:45:00 +0000 (22:45 +0200)
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MainTVServerService.java

index 7e69a1839e5b2ce56d59bcc069a874f48d99db9e..30fab9d126de38f400d1425b052cb8abe1fc6708 100755 (executable)
@@ -342,10 +342,11 @@ public class MainTVServerService implements UpnpIOParticipant, SamsungTvService
         // NodeList doesn't have a stream, so do this
         sources = Optional.of(updateResourceState("GetSourceList")).filter(a -> "OK".equals(a.get("Result")))
                 .map(a -> a.get("SourceList")).flatMap(xml -> Utils.loadXMLFromString(xml, host))
-                .map(a -> a.getDocumentElement()).map(a -> a.getElementsByTagName("Source"))
+                .map(a -> a.getDocumentElement()).map(
+                        a -> a.getElementsByTagName("Source"))
                 .map(nList -> IntStream.range(0, nList.getLength()).boxed().map(i -> (Element) nList.item(i))
                         .collect(Collectors.toMap(a -> getFirstNodeValue(a, "SourceType", ""),
-                                a -> getFirstNodeValue(a, "ID", ""))))
+                                a -> getFirstNodeValue(a, "ID", ""), (key1, key2) -> key2)))
                 .orElse(Map.of());
     }