New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sonos] Prevent logging unsupported device #16141
Conversation
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
@@ -83,7 +83,8 @@ public Set<ThingTypeUID> getSupportedThingTypeUIDs() { | |||
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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lolodomo i would prefer equals above contains, but in that case the constant needs all exact modelnames. Do you know them or have a source where i can find them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we discover them each time Sonos introduces a new model...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com> Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Some devices like subs are more or less a transparant slave and are not added to openHAB as Thing. As the amount of devices slowly grows a more future proof check is needed to prevent unwanted logging.
Fixes: #16125