Skip to content
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

Merged
merged 1 commit into from Dec 31, 2023

Conversation

lsiepel
Copy link
Contributor

@lsiepel lsiepel commented Dec 29, 2023

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

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
@lsiepel lsiepel added the bug An unexpected problem or unintended behavior of an add-on label Dec 29, 2023
@@ -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())
Copy link
Contributor Author

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?

Copy link
Contributor

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...

Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@lolodomo lolodomo merged commit 105ce62 into openhab:main Dec 31, 2023
3 checks passed
@lolodomo lolodomo added this to the 4.2 milestone Dec 31, 2023
@lsiepel lsiepel deleted the sonos-unsupported branch December 31, 2023 11:05
dbadia pushed a commit to dbadia/openhab2-addons that referenced this pull request Dec 31, 2023
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Cybso pushed a commit to Cybso/openhab-addons that referenced this pull request Jan 5, 2024
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
@jlaur jlaur changed the title [sonos] prevent logging unsupported device [sonos] Prevent logging unsupported device Mar 3, 2024
austvik pushed a commit to austvik/openhab-addons that referenced this pull request Mar 27, 2024
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[sonos] Add Support For Sonos Sub Mini To Sonos Binding
2 participants