]> git.basschouten.com Git - openhab-addons.git/commitdiff
[sonos] Fix discovery of Ikea SYYMFONISK models (#10323)
authorlolodomo <lg.hc@free.fr>
Sun, 14 Mar 2021 17:16:40 +0000 (18:16 +0100)
committerGitHub <noreply@github.com>
Sun, 14 Mar 2021 17:16:40 +0000 (18:16 +0100)
Fix #10313

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/discovery/ZonePlayerDiscoveryParticipant.java

index d4458d430edfeab63c549490d903761224406120..f9102a9e67bff65464ec7520adc04244d5066a09 100644 (file)
@@ -117,7 +117,10 @@ public class ZonePlayerDiscoveryParticipant implements UpnpDiscoveryParticipant
     }
 
     private String getModelName(RemoteDevice device) {
-        return SonosXMLParser.extractModelName(device.getDetails().getModelDetails().getModelName());
+        // For Ikea SYMFONISK models, the model name now starts with "SYMFONISK" with recent firmwares
+        // We can no more use extractModelName as it deletes the first word ("Sonos" for all other devices)
+        return device.getDetails().getModelDetails().getModelName().toUpperCase().contains("SYMFONISK") ? "SYMFONISK"
+                : SonosXMLParser.extractModelName(device.getDetails().getModelDetails().getModelName());
     }
 
     private @Nullable String getSonosRoomName(RemoteDevice device) {