-
-
Notifications
You must be signed in to change notification settings - Fork 29k
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 remote support #120878
Add alexa remote support #120878
Conversation
…ded an alexa entitiy adapter for the remote domain.
…ng locale. This local is read from the users config.
Hey there @home-assistant/cloud, @ochlocracy, @jbouwh, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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 am not sure this PR is in the correct direction.
According to https://developer.amazon.com/en-US/docs/alexa/smarthome/wwa-device-requirements.html, we should implement:
Not the mode controller. At least I would not be the first controller to implement.
The problem for the input controller is that it only accepts predefined activity names. I think this is actually the same way how the harmony hub handles those alexa requests. |
Fix copy paste mistakes. Co-authored-by: Jan Bouwhuis <[email protected]>
Co-authored-by: Jan Bouwhuis <[email protected]>
…r a remote entitiy.
With commit 86952ad i added a test to check if all the required interfaces for a remote are part of the discovery response. I think it would make sense to make this a method in test_common.py, but I did not do this because i do not want to blow up the PR any more. Say so if i should do it here directly. |
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.
Just some minor comments, nice work!
Thank you :) |
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.
Have some trouble getting a passed CI test, think the failures are not related.
Nice first contribution 🥇
Thanks @CrazyMan2000 👍
Thanks, i had a lot of fun! Looking forward to my next PR 😄 |
Please address the comments in a new PR. Thanks! |
@@ -1200,6 +1205,17 @@ async def async_api_set_mode( | |||
msg = f"Entity '{entity.entity_id}' does not support Mode '{mode}'" | |||
raise AlexaInvalidValueError(msg) | |||
|
|||
# Remote Activity | |||
if instance == f"{remote.DOMAIN}.{remote.ATTR_ACTIVITY}": |
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.
Seems we could have used elif
here to avoid additional checks like we do for the other cases
Proposed change
Added an update for the alexa integration to support the remote domain.
Since the friendly names for the mode controller are one to one the activity names from the remote entity a proper locale must be send with it. To archive this I added the user's alexa configuration to the AlexaCapability class, so the locale from the config can be used.
I added the whole config instead of only the locale because thereby other improvements are possible later, for example setting different names for an activity.
Type of change
Additional information
Related to this community thread:
https://community.home-assistant.io/t/alexa-mode-controller-harmony-hub/488905
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: