-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
Add Alexa.ChannelController functions for media players #27671
Conversation
Hey there @home-assistant/cloud, @ochlocracy, mind taking a look at this pull request as its been labeled with a integration ( |
This is a a resubmit of my previous pull request. Due to issues with my dev environment , I felt it best to start fresh. I now have the tox , flake8, pylint programs running correctly. |
f28809c
to
6653f57
Compare
Hi @Dilbert66 I've seen your code and looks good... |
A safety delay is a good idea actually. There is processing delay induced with the call but I agree, i will add it. |
Thank you. I've made the recommended changes , re-tested and commited. |
0ff29d5
to
6302b5d
Compare
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.
Excellent! I had just merged another PR for Alexa so there are some merge conflicts.
This PR can be merged when the conflicts have been resolved.
Great first contribution! 🐬 Welcome to the Home Assistant community 🎉
…hannel and SkipChannel commands. These functions will call the play_media function in a media_player app if it has the capability published and pass on the channel# or channel name. The selected media player can then use this to select the channel on the device it is associated to. Modified the existing Alexa.StepSpeaker Setvolume function to actually do a stepped volume change using the steps sent by Alexa. The Alexa default step of 10 for a simple volume up/down can be changed via an exposed media_player attribute called volume_step_default. The default is set to 1. Any other value then default will be sent as sequential volume up /down to the media_player.
…d to surround them in quotes for the tests to pass properly.
…ut the behavior in the handler. The test suite does not like multiple await calls in a loop. Will investigate further. The handler code works though.
Added test for callSign payload attribute.
…ons. Removed name options from metadata payload section. not needed.
…t sure if it was the cause of the pytest's failing on github
Moved service type decision out of for loops in ChannelController and StepSpeaker Used constants instead of numeric values for support options in test module
Re-ordered constants in test_smart_home.py
…constant instead of hard coded value.
Thank you! Conflicts resolved and re-pushed. I see that the Python37 checks are failing but from the looks of the azure logs, this looks to be an issue outside of this pull request. |
🎉 |
Added missing Alexa.ChannelController functions. Specifically Change Channel and SkipChannel commands. These functions will call the play_media function in a media_player app if it has the capability published and pass on the channel# or channel name. The selected media player can then use this to select the channel on the device it is associated to.
Modified the existing Alexa.StepSpeaker Setvolume function to actually do a stepped volume change using the steps sent by Alexa. The Alexa default step of 10 for a simple volume up/down can be changed via an exposed media_player attribute called volume_step_default. The default is set to 1.
Any other value than default will be sent as a looped sequence of volume up/down calls to the media_player.
Modifed the test script test_smart_home.py to add the missing payload attribute volumeStepDefault and test for it. Also added ChannelController tests.
Checklist:
tox
. Your PR cannot be merged unless tests passIf the code does not interact with devices:
Checks the Channel controller box in #24579