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 voluptuous config validation to scenes #6830

Merged
merged 1 commit into from Mar 29, 2017

Conversation

MartinHjelmare
Copy link
Member

@MartinHjelmare MartinHjelmare commented Mar 28, 2017

Description:

  • Add platform schema to scene component and homeassistant platform.
  • Clean up code and add constants.
  • Add unit test and clean up tests.

Related issue (if applicable):
fixes #6641, closes #6815

Checklist:

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

* Add platform schema to scene component and homeassistant platform.
* Clean up code and add constants.
* Add unit test and clean up tests.
@mention-bot
Copy link

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

vol.Schema({
vol.Required(CONF_PLATFORM): cv.platform_validator(DOMAIN)
}, extra=vol.ALLOW_EXTRA),
_platform_validator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this automatically done by async_setup_component when it detects a PLATFORM_SCHEMA ?

https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/config.py#L540-L572

Edit: oh realized now that it is not happening for hass platforms because we support the old config too.

@balloob balloob merged commit 7c614a6 into home-assistant:dev Mar 29, 2017
@balloob
Copy link
Member

balloob commented Mar 29, 2017

Nice! 🐬

@Chris-V
Copy link
Contributor

Chris-V commented Apr 1, 2017

I had some time to try this out and so far it works perfectly. Scenes within packages get merged! Thanks a lot :)

@MartinHjelmare MartinHjelmare deleted the add-scene-validation branch April 1, 2017 17:38
@fabaff fabaff mentioned this pull request Apr 6, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Jul 17, 2017
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't define scene in multiple packages?
6 participants