-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Revbump to SoCo 0.13, add support for Night Sound and Speech Enhancement #10765
Conversation
@property | ||
def device_state_attributes(self): | ||
"""Return device specific state attributes.""" | ||
return {ATTR_IS_COORDINATOR: self.is_coordinator} | ||
|
||
attributes = {ATTR_IS_COORDINATOR: self.is_coordinator} |
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.
multiple spaces after operator
I've added docs PR and I think this is ready to merge. I cobbled together a simple test based on the patterns I saw for testing the other features. Local testing with my speakers works fine, too, of course. |
@property | ||
def night_sound(self): | ||
"""Get status of Night Sound.""" | ||
if self._coordinator: |
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.
You defer to the coordinator. Are these options really per-group (like a playlist), not per-speaker (like volume)?
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 did some research using two speakers (Kitchen, Den) of my multi-unit setup. Den is a Playbar that supports the night_sound (NS) and speech_enhance (SE) features when playing from the TV source.
- When I build a group designating Kitchen as the coordinator and then switch to the TV source the Den then becomes the coordinator.
- When playing TV in a group the NS and SE effects are audible on the Den but not the Kitchen.
- SoCo will not send NS and SE commands to a non-Playbar speaker.
Based on #2 I agree with you that this is a per-speaker feature. This was masked by the Sonos behavior described in #1.
I'll push a new version that does not defer to the coordinator momentarily. It will not include a check to ensure that the speaker is the coordinator but given #3 this should not cause an error.
Sound good? Thank you for the close review.
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 pushed an updated version per your comments. I also rebased to the current dev branch.
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 like your changes though if the Playbar always ends up being the coordinator, I guess it doesn't matter much.
…cement. Sonos Playbar and Playbase devices support Night Sound and Speech Enhancement effects when playing from sources such as a TV. Adds a new service "sonos_set_option" whichs accepts boolean options to control these audio features.
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.
Looks good 👍. I hope you will help move this to events when/if #10419 gets merged.
…cement. (#10765) Sonos Playbar and Playbase devices support Night Sound and Speech Enhancement effects when playing from sources such as a TV. Adds a new service "sonos_set_option" whichs accepts boolean options to control these audio features.
Ready to pull.
Description:
Sonos Playbar and Playbase devices support Night Sound and Speech Enhancement
effects when playing from sources such as a TV. Adds a new service "sonos_set_option"
whichs accepts boolean options to control these audio features.
Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass