Skip to content
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 valid inputs to alexa InputController #28483

Merged

Conversation

@ochlocracy
Copy link
Member

ochlocracy commented Nov 2, 2019

Description:

The list of available source for a media_player should be specified in an inputs array for the InputController during the discovery process. The list of valid inputs is also predefined in the Alexa API. This PR translates the source_list for the media_player entity into a valid list for discovery. It also updates the handlers to translates the Alexa API names into valid HA names.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • Tests have been added to verify that the new code works.
@probot-home-assistant

This comment has been minimized.

Copy link

probot-home-assistant bot commented Nov 2, 2019

Hey there @home-assistant/cloud, mind taking a look at this pull request as its been labeled with a integration (alexa) you are listed as a codeowner for? Thanks!

@project-bot project-bot bot moved this from Needs review to By Code Owner in Dev Nov 2, 2019
@ochlocracy ochlocracy mentioned this pull request Nov 2, 2019
4 of 9 tasks complete
@quthla

This comment has been minimized.

Copy link
Contributor

quthla commented Nov 3, 2019

I think this will fail for sources named like HDMI 1

ochlocracy added 3 commits Nov 3, 2019
…-list' into alexa-input-controller-add-input-list
@ochlocracy

This comment has been minimized.

Copy link
Member Author

ochlocracy commented Nov 3, 2019

I think this will fail for sources named like HDMI 1

Can you elaborate?

@quthla

This comment has been minimized.

Copy link
Contributor

quthla commented Nov 3, 2019

If source in HA has a blank in it, it will not be found in the valid source map. Am I wrong?

@ochlocracy

This comment has been minimized.

Copy link
Member Author

ochlocracy commented Nov 3, 2019

If source in HA has a blank in it, it will not be found in the valid source map. Am I wrong?

Nope.

I was under the assumption HA lower cased and replaced spaces with under score for that attributes... but I can't confirm where I got that idea now... Looks like it's up to the integration to determine the name.

I'll account for that.

@ochlocracy

This comment has been minimized.

Copy link
Member Author

ochlocracy commented Nov 3, 2019

@quthla Thanks for finding that.

Looks like I had already accounted for spaces in the handler, but never did during discovery. Added additional tests to account for a space, and case.

Dev automation moved this from By Code Owner to Reviewer approved Nov 25, 2019
@balloob balloob merged commit 970a802 into home-assistant:dev Nov 25, 2019
11 checks passed
11 checks passed
CI Build #20191103.18 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch 100% of diff hit (target 94.36%)
Details
codecov/project 94.36% (target 90%)
Details
Dev automation moved this from Reviewer approved to Done Nov 25, 2019
@lock lock bot locked and limited conversation to collaborators Nov 26, 2019
@ochlocracy ochlocracy deleted the ochlocracy:alexa-input-controller-add-input-list branch Dec 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
4 participants
You can’t perform that action at this time.