]> git.basschouten.com Git - openhab-addons.git/commitdiff
[sonos] Ignore Sonos Boost at discovery (#17318)
authorlolodomo <lg.hc@free.fr>
Fri, 23 Aug 2024 19:59:52 +0000 (21:59 +0200)
committerGitHub <noreply@github.com>
Fri, 23 Aug 2024 19:59:52 +0000 (21:59 +0200)
Fixes #17307

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

index d1939f0987b9ee4b35532cbad11e9452ef715c56..c5fecb88f1e3c624f4d7ba935684e4af9a8f37cf 100644 (file)
@@ -1016,7 +1016,7 @@ public class SonosXMLParser {
         }
         // Finally remove unexpected characters in a thing type ID
         id = id.replaceAll("[^a-zA-Z0-9_]", "");
-        // ZP80 is translated to CONNECT and ZP100 to CONNECTAMP
+        // ZP80 is translated to CONNECT and ZP100 to CONNECTAMP; Boost is ignored
         switch (id) {
             case "ZP80":
                 id = "CONNECT";
@@ -1024,6 +1024,9 @@ public class SonosXMLParser {
             case "ZP100":
                 id = "CONNECTAMP";
                 break;
+            case "Boost":
+                id = "";
+                break;
             default:
                 break;
         }
index 65857dd5a0a7a0b1b575529b87852c4098a7e182..884db2d2ae3e30b1634c716198223932b0f8c2de 100644 (file)
@@ -66,6 +66,11 @@ public class SonosXMLParserTest {
         assertEquals("OneSL", SonosXMLParser.buildThingTypeIdFromModelName("Sonos One SL (OpenHome)"));
     }
 
+    @Test
+    public void buildThingTypeIdFromBoost() {
+        assertEquals("", SonosXMLParser.buildThingTypeIdFromModelName("Sonos Boost"));
+    }
+
     @Test
     public void getRadioTimeFromXML() throws IOException {
         InputStream resourceStream = getClass().getResourceAsStream("/OPML.xml");