Skip to content

Add voluptuous config validation to scenes#6830

Merged
balloob merged 1 commit into
home-assistant:devfrom
MartinHjelmare:add-scene-validation
Mar 29, 2017
Merged

Add voluptuous config validation to scenes#6830
balloob merged 1 commit into
home-assistant:devfrom
MartinHjelmare:add-scene-validation

Conversation

@MartinHjelmare
Copy link
Copy Markdown
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
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
Member

balloob commented Mar 29, 2017

Nice! 🐬

@Chris-V
Copy link
Copy Markdown
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