Skip to content

UPNP don't notify embedded child devices by default #4735

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andrewfg
Copy link
Contributor

See #4712

Signed-off-by: Andrew Fiddian-Green software@whitebear.ch

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg requested a review from a team as a code owner April 21, 2025 09:01
@andrewfg
Copy link
Contributor Author

Ping @lolodomo ..

Note: I wrote the code, but I do not have any time for testing, so can you please have a look at it yourself.

@andrewfg
Copy link
Contributor Author

@lo92fr if your addon discovery service participant wants to be notified about embedded child devices then it will have to override the notifyChildDevices() method.

@mherwege
Copy link
Contributor

See my question: #4712 (comment)

@andrewfg
Copy link
Contributor Author

andrewfg commented Apr 21, 2025

@mherwege either we have to modify..

  • some bindings to prevent them seeing unwanted children (e.g. Sonos) (opt out model), or
  • other bindings to explicitly allow them to see wanted children (opt in model)

On balance I think the opt in model is safer.

@mherwege
Copy link
Contributor

@mherwege either we have to modify..

  • some bindings to prevent them seeing unwanted children (e.g. Sonos) (opt out model), or
  • other bindings to explicitly allow them to see wanted children (opt in model)

On balance I think the opt in model is safer.

For upnpcontrol, which is a generic binding, you would want to see the embedded devices. That would mean the Sonos embedded media server and renderer would be discovered. I believe that is what @lolodomo wanted to prevent. It is easy enough to not have them discovered by the Sonos binding (opt-in or opt-out doesn’t matter). But you can’t avoid discovering it with the upnpcontrol binding.

@andrewfg
Copy link
Contributor Author

andrewfg commented Apr 21, 2025

@mherwege I think you misunderstand this. The OH Core service will ALWAYS discover both root and embedded devices. The bindings respective discovery participants will by default not receive the NOTIFICATIONS for embedded devices. And it you want your addon's disco participant to receive those notifications then you need to make a one liner override of its notifyChildDevices() method.

@mherwege
Copy link
Contributor

mherwege commented Apr 21, 2025

@mherwege I think you misunderstand this. The OH Core service will ALWAYS discover both root and embedded devices. The bindings respective discovery participants will by default not receive the NOTIFICATIONS for embedded devices. And it you want your addon's disco participant to receive those notifications then you need to make a one liner override of its notifyChildDevices() method.

I think I understand this well enough. Again: you would want to override this for the upnpcontrol binding because that binding would want to see the embedded devices for many devices (e.g. Denon has their media player as an embedded device). Therefore it will discover the embedded Sonos media server and media renderer. You cannot avoid that for upnpcontrol. That’s why I asked @lolodomo what binding discovered these embedded devices. Was it the sonos binding or the upnpcontrol binding?

@lolodomo
Copy link
Contributor

That’s why I asked @lolodomo what binding discovered these embedded devices. Was it the sonos binding or the upnpcontrol binding?

The Sonos binding.
The upnpcontrol binding is not installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants