Allow scene configs to be merged#6815
Conversation
|
|
||
| PLATFORM_SCHEMA = vol.Schema({ | ||
| vol.Required(CONF_NAME): cv.string, | ||
| vol.Required(CONF_ENTITIES): cv.ordered_dict(cv.match_all, cv.entity_id), |
There was a problem hiding this comment.
I'm not sure about the match_all values here. As opposed to no schema validations I guess it's not that bad, but it could be improved I guess.
There was a problem hiding this comment.
You add the platfrom schema from default platform homeassistant into component. I don't think that will be correct for other platform too and they have no unittests. So you pass all test but I don't think that will be pass into real world. Mybe @balloob have a better view over all platform. You need also extend it from helper/config_validator and move that to platform self.
|
I added config validation for scenes for a closed PR. I think that is the correct way. You can copy that if you like: |
|
Nice work and thanks a lot! I had very limited time this week to look at this :) I can cherry-pick your commit in this branch or you can open another PR. This way credit is given where credit is due ;) |
|
@Chris-V |
Description:
It is currently not possible to use scenes inside packages. This PR adds a PLATFORM_SCHEMA field to
scene/__init__.pyso that it can be analysed and merged on boot. Existing tests still pass locally.Related issue (if applicable): fixes #6641
Example entry for
configuration.yaml(if applicable):Scenes configuration stays the same as defined in https://home-assistant.io/components/scene/
Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
toxrun successfully. Your PR cannot be merged unless tests passREQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.If the code does not interact with devices:
toxrun successfully. Your PR cannot be merged unless tests pass