Skip to content

Support specifying no Apple TVs#9394

Merged
balloob merged 1 commit into
home-assistant:devfrom
postlund:fix_atv_scan
Sep 13, 2017
Merged

Support specifying no Apple TVs#9394
balloob merged 1 commit into
home-assistant:devfrom
postlund:fix_atv_scan

Conversation

@postlund
Copy link
Copy Markdown
Contributor

Description:

In order to use the scan functionality in the Apple TV platform, the actual platform must be loaded. This is not possible as the input validation requires at least one device to be added (and some other minor changes).

I tried to use ensure_list to validate this, but if nothing is specified an empty dict ({}) is passed to the validator which just wraps it in a list triggers validation of a device. I added my own version of ensure_list that interprets an empty dict as no item at all to cover this special case. I'm not sure this is a good solution so it would be good if someone commented on this.

Related issue (if applicable): fixes #9362

Example entry for configuration.yaml (if applicable):

apple_tv:

Checklist:

If the code communicates with devices, web services, or third-party tools:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

@mention-bot
Copy link
Copy Markdown

@postlund, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob and @armills to be potential reviewers.

@balloob balloob merged commit f5ffef3 into home-assistant:dev Sep 13, 2017
@postlund postlund deleted the fix_atv_scan branch September 13, 2017 05:30
@balloob balloob mentioned this pull request Sep 22, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Mar 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can not scan for Apple TV:s without adding an Apple TV first

5 participants