From 7394ba0603b2156f11e2a8983a9dda36f9c79fe1 Mon Sep 17 00:00:00 2001 From: Nick Waterton Date: Wed, 22 May 2024 17:45:00 -0300 Subject: [PATCH] [samsungtv] fix input change bug (#16787) Signed-off-by: Nick Waterton --- .../samsungtv/internal/service/MainTVServerService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MainTVServerService.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MainTVServerService.java index 7e69a1839e5..30fab9d126d 100755 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MainTVServerService.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MainTVServerService.java @@ -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()); }