]> git.basschouten.com Git - openhab-addons.git/commit
[sonos] Discovery of unsupported models without exception (#12609)
authorlolodomo <lg.hc@free.fr>
Sat, 16 Apr 2022 20:38:44 +0000 (22:38 +0200)
committerGitHub <noreply@github.com>
Sat, 16 Apr 2022 20:38:44 +0000 (22:38 +0200)
commit2a4482a26a356c5085db91aac5ec09185be04b5a
tree07ad15ea7054eff0461fccd6588cbdb1a415bc50
parent77ed54d338b83eeff03ee2656159ea4c9c83c6b6
[sonos] Discovery of unsupported models without exception (#12609)

* [sonos] Discovery of unsupported models without exception
* Unit tests added for method extractModelName
* Replace extractModelName by buildThingTypeIdFromModelName

Transform the found model name into a valid thing type ID when trying
to match a thing type

This could avoid an IllegalArgumentException thrown by the discovery
service when new models will be introduced on the market.

Should be compatible with Bubble UPnP Server which modifies the model
name

A message is now logged for unsupported Sonos models.

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/main/java/org/openhab/binding/sonos/internal/discovery/ZonePlayerDiscoveryParticipant.java
bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/handler/ZonePlayerHandler.java
bundles/org.openhab.binding.sonos/src/test/java/org/openhab/binding/sonos/internal/SonosXMLParserTest.java [new file with mode: 0644]