Initial fix (#16141)

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
lsiepel 2023-12-31 11:55:41 +01:00 committed by GitHub
parent 607c647734
commit 105ce627e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -75,6 +75,8 @@ public class SonosBindingConstants {
MOVE2_THING_TYPE_UID, ROAM_THING_TYPE_UID, ROAM_SL_THING_TYPE_UID, ERA_100_THING_TYPE_UID,
ERA_300_THING_TYPE_UID);
public static final Set<String> UNSUPPORTED_KNOWN_IDS = Set.of("sub", "sonos sub mini");
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>(SUPPORTED_KNOWN_THING_TYPES_UIDS);
static {
SUPPORTED_THING_TYPES_UIDS.add(ZONEPLAYER_THING_TYPE_UID);

View File

@ -83,7 +83,8 @@ public class ZonePlayerDiscoveryParticipant implements UpnpDiscoveryParticipant
String id = SonosXMLParser
.buildThingTypeIdFromModelName(device.getDetails().getModelDetails().getModelName());
String udn = device.getIdentity().getUdn().getIdentifierString();
if (!id.isEmpty() && !"Sub".equalsIgnoreCase(id) && !udn.isEmpty()) {
if (!id.isEmpty() && !SonosBindingConstants.UNSUPPORTED_KNOWN_IDS.contains(id.toLowerCase())
&& !udn.isEmpty()) {
ThingTypeUID thingTypeUID = new ThingTypeUID(SonosBindingConstants.BINDING_ID, id);
if (!SonosBindingConstants.SUPPORTED_KNOWN_THING_TYPES_UIDS.contains(thingTypeUID)) {
// Try with the model name all in uppercase