mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
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:
committed by
Paulus Schoutsen
parent
5ee4718e24
commit
ad47ece5c6
@@ -171,7 +171,7 @@ def _no_duplicate_auth_mfa_module(configs: Sequence[Dict[str, Any]]) \
|
||||
|
||||
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)}) # Component configuration
|
||||
})
|
||||
|
||||
CUSTOMIZE_DICT_SCHEMA = vol.Schema({
|
||||
@@ -662,7 +662,10 @@ def merge_packages_config(hass: HomeAssistant, config: Dict, packages: Dict,
|
||||
for comp_name, comp_conf in pack_conf.items():
|
||||
if comp_name == CONF_CORE:
|
||||
continue
|
||||
component = get_component(hass, comp_name)
|
||||
# If component name is given with a trailing description, remove it
|
||||
# when looking for component
|
||||
domain = comp_name.split(' ')[0]
|
||||
component = get_component(hass, domain)
|
||||
|
||||
if component is None:
|
||||
_log_pkg_error(pack_name, comp_name, config, "does not exist")
|
||||
|
||||
Reference in New Issue
Block a user