bitfocus / companion

Bitfocus Companion enables the reasonably priced Elgato Streamdeck and other controllers to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
Other
1.45k stars 489 forks source link

SSDP Discovery Helper #2807

Open peternewman opened 3 months ago

peternewman commented 3 months ago

Is this a feature relevant to companion itself, and not a module?

Is there an existing issue for this?

Describe the feature

Off the back of #2087 , it would be great to do the same sort of thing but for SSDP.

For example Sony Bravia use this which would benefit https://github.com/bitfocus/companion-module-sony-bravia/ . Others have implemented SSDP in other tools to discover it (e.g. https://github.com/home-assistant/core/pull/77772 ).

Here's their relevant code https://github.com/home-assistant/core/commit/7c460cc641f16077943585473be40a416783b924#diff-0af27839888d627dfb217e7ae091cd8cc5f24627d03f7f79f130db04d781b3ebR142-R157

So in that case filtering for a particular attribute within a third level hash looks to be sufficient.

Usecases

Similar to the Bonjour stuff, allow the system to suggest suitable/valid hostnames.

In future possibly even suggest modules/connections to add/load similar to #2088 for Bonjour.

Julusian commented 3 months ago

I don't expect to look into this myself (not for a while at least) as I don't think I have anything on my network which uses SSDP, so testing anything will be hard. But If someone else wants to do it I can provide some support/assistance.

It isn't that much code to do, I would do this by copying the bonjour classes/components added in https://github.com/bitfocus/companion/pull/2428/files to make SSDP versions of everything, then redo the implementations to be using SSDP. A corresponding change is needed in the module-base to allow modules to use this: https://github.com/bitfocus/companion/pull/2428/files

peternewman commented 3 months ago

Thanks @Julusian . I'm not sure I've got any SSDP device on my main network either TBH or will either get to it particularly soon.

I assume you mean https://github.com/bitfocus/companion-module-base/pull/57/files for the module-base changes?

I guess with half of this, choosing a suitable SSDP library might be part of the challenge too.

Julusian commented 3 months ago

Ooh, I do have something which does SSDP, Sonos uses that. So I could look into this and use that module as a reference implementation https://github.com/bitfocus/companion-module-sonos-speakers

I'll add this to my list of things to consider looking into, when I want something new to pick up