-
-
Notifications
You must be signed in to change notification settings - Fork 145
Logical Device Support #49
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
Conversation
|
Awesome! 😸 Defo need to keep state. There's a way of using |
|
@bencevans, @mrose17 - some things that probably need to be thought about:
This would also impact how things like the current I'm partial to the first solution, though we would consider it a breaking change to how the API works. We can also have Edit: It occurs to me the above notes are all about adding better eventing support, but that's necessary to get logical device support working well. |
|
Up to this point - logical devices currently work for volume changing (example in Before merge, we should also implement a Tricky thing about this is how to know how long to wait before grouping things... i.e. since current search emits events for each new device to crop up, Perhaps an alternative is to get a single device, and |
I'm happy with that.
Personally I prefer the first option too, also I think it's a much friendlier interface for new comers (especially Express lovers!)
Hmm, I wonder what the Sonos Controller apps work on that one. For now a timeout would be great! Trying to |
|
@bencevans - I've written up a search function that uses getZoneTopology from the first device it finds (assumes that a given device will have consensus on all other devices) which is pretty fast. Would it make sense as a separate PR after this merges, or all together here? Further - I think we should also consider the idea of responding to changing topology, i.e. emitting an event when groups change or devices enter/exit. It might make sense to have a... |
|
hi. i agree that implementing EventEmitter is a good idea. i am very concerned about breaking existing behavior though. if that's necessary, then we need to bump the version to 1.0.x overall, these are very positive changes to the package, so i'm happy to help out as needed. |
Oh yeah that method defo sounds best. Shall we make a 1.x branch and submit pull requests to that?
Definitely needs to be a new major version, I think the incentives for people to upgrade to use the new version would be quite beneficial |
|
Yeah if you could open a 1.0.0 relase branch, it'd be good. Will close this and open a new PR against 1.0.0 when that's happened. The search stuff needs more thought, so I'll open two separate PRs for it. |
|
Closing in favor of #53 |
|
Shiny new 1.x branch! https://github.com/bencevans/node-sonos/tree/1.x Awesome |
This is not ready for merge!
Implements logical devices with volume support.
While this works, it's incredibly slow, considering the number of callbacks/network requests at work. To get around this, we'll likely need to maintain client-side state for volumes and use event listeners to keep up to date.