bencevans / node-sonos

🔈 Sonos Media Player Interface/Client
https://www.npmjs.com/package/sonos
MIT License
702 stars 147 forks source link

Idea: Promisified Version of device discovery #419

Closed svrooij closed 5 years ago

bencevans commented 5 years ago

I like the idea!

Maybe something along the lines of...

await sonos.discoverOne()
// Returns after first instance is found out times out

await sonos.discover({timeout: 2 * 1000})
// Returns an array of all that have announced within a sensible default

On Sun, 2 Jun 2019, 20:55 Stephan van Rooij, notifications@github.com wrote:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bencevans/node-sonos/issues/419?email_source=notifications&email_token=AAE34R5QN5FDEOG5O2DFHEDPYQQS3A5CNFSM4HSDMGD2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GXFGKFA, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE34R3VF563XM6H5FP64QDPYQQS3ANCNFSM4HSDMGDQ .

ebaauw commented 5 years ago

You only need a UPnP announcement from one zoneplayer. When subscribing to ZoneGroupTopology events, you receive an event containing all zoneplayers in the household. It also contains enough info to determine which zoneplayers are (stereo pair) slaves or (home theatre) satellites. It does require recursively invoking the XML to javascript conversion.

bencevans commented 5 years ago

:tada: This issue has been resolved in version 1.12.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: