-
Notifications
You must be signed in to change notification settings - Fork 229
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
Improve collection of Zone Group State for large Sonos systems (partial fix for #518 / #935) #937
Conversation
I'm a little hesitant about this approach:
|
Thanks for the comments, @jjlawren.
The events-based approach is only invoked if a normal query fails. It's a last resort, so if it fails due to network limitations it's still better than not trying.
The cacheing logic limits ZGS refreshes to at most once per 5 seconds by default (using
The logic currently only handles the standard events module. I'll try adding support for the others, although I could apply the same 'it's better than nothing' rationale as for (1). Of course, this is all predicated on this approach actually working for large speaker populations! Reading through the issues (e.g., #518 (comment)) makes me optimistic that it might. I'm looking forward to seeing some results from the use of your test script on suitably large systems. |
Hi @jjlawren: I've now added support for If you get a moment, perhaps you could take a look at ~ lines 181-207 and point out the right way to approach this? In particular I couldn't figure out how to retrieve the ZGS from the callback without resorting to a global. |
I'd really like to have confirmation that this is the actual underlying issue first. In my downstream implementation that uses |
Agree.
I think I'd like a default that works without plunging users into having to understand how to subscribe to and process ZGT events, etc. I take your point, though, so we should provide a config option to opt out of the fallback behaviour. |
In its current state this PR is a sticking plaster that falls back to using a ZoneGroupTopology event to determine the ZoneGroupState if a direct
It's likely that if |
- Remove immediate fallback to events - Refactor
Hi @jjlawren: From my perspective this is ready to merge now, and your review would be welcome. There's support for falling back to using a ZGT event under the default Hi @KennethNielsen FYI, in case you want to take a look. I'd like to land this in v0.29, to be released within the next week or so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few questions, mostly related to async I probably just don't understand.
Thanks @jjlawren and @KennethNielsen for taking the time to review this PR, and thanks also to @jjlawren for the insight that led to creating this workaround. It still lacks support for I'll merge this in the next day or two, and release SoCo v0.29. |
No description provided.