-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
Allow split component definitions in packages #16177
Allow split component definitions in packages #16177
Conversation
Hi @thomasloven, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
homeassistant/config.py
Outdated
@@ -130,7 +130,7 @@ | |||
|
|||
PACKAGES_CONFIG_SCHEMA = vol.Schema({ | |||
cv.slug: vol.Schema( # Package names are slugs | |||
{cv.slug: vol.Any(dict, list, None)}) # Only slugs for component names | |||
{cv.string: vol.Any(dict, list, None)}) # Only slugs for component names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (81 > 79 characters)
Hi @thomasloven, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have looked at this PR before but not commented because I could not believe that such a simple change could work. It was actually less typing to make it work than it was to describe that it did not work.
This area of the code is unknown to me but now I looked at the PR more closely and I don't see why it wouldn't work. That is awesome.
I only have a few suggestions for the comments and you can feel free to ignore those since comment style is subjective anyway.
However, some tests should be added (to tests/test_config.py
). I think we will want a test with several entries for the same component being merged in (like light 1:
, light 2:
) since that was one situation I was wondering about.
Thanks. I agree, it's suspiciously simple. I'll look at implementing a test of some sort too. Thanks for the pointer on where to start! |
I've added a test that checks that components like |
Two different configuration styles are described in https://www.home-assistant.io/docs/configuration/devices/#style-2-list-each-device-separately But only one is allowed in packages according to https://www.home-assistant.io/docs/configuration/packages/ This change allows "Style 2" configuration in packages.
Congrats on your first PR merged 🎉 |
Thank you! |
Description:
Two different configuration styles are described in
https://www.home-assistant.io/docs/configuration/devices/#style-2-list-each-device-separately
But only one is allowed in packages according to
https://www.home-assistant.io/docs/configuration/packages/
This change allows "Style 2" configuration in packages.
Related issue: N/A
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#6075
Example entry for
configuration.yaml
(if applicable):packages/my_package.yaml
Checklist:
The code change is tested and works locally.
Local tests pass with
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices: