Allow split component definitions in packages (#16177)
* Allow split component definitions in packages 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. * Added test for split component definition in packages
This commit is contained in:
parent
5ee4718e24
commit
ad47ece5c6
2 changed files with 23 additions and 2 deletions
|
@ -965,3 +965,21 @@ async def test_disallowed_duplicated_auth_mfa_module_config(hass):
|
|||
}
|
||||
with pytest.raises(Invalid):
|
||||
await config_util.async_process_ha_core_config(hass, core_config)
|
||||
|
||||
|
||||
def test_merge_split_component_definition(hass):
|
||||
"""Test components with trailing description in packages are merged."""
|
||||
packages = {
|
||||
'pack_1': {'light one': {'l1': None}},
|
||||
'pack_2': {'light two': {'l2': None},
|
||||
'light three': {'l3': None}},
|
||||
}
|
||||
config = {
|
||||
config_util.CONF_CORE: {config_util.CONF_PACKAGES: packages},
|
||||
}
|
||||
config_util.merge_packages_config(hass, config, packages)
|
||||
|
||||
assert len(config) == 4
|
||||
assert len(config['light one']) == 1
|
||||
assert len(config['light two']) == 1
|
||||
assert len(config['light three']) == 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue