1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-12 06:43:48 +01:00

improve grouping of no bus components, they can go into any group, saves another 20m

This commit is contained in:
J. Nick Koston
2025-10-09 17:03:51 -10:00
parent dc18dd164a
commit 9b9b4195f2
4 changed files with 47 additions and 4 deletions

View File

@@ -206,11 +206,21 @@ def merge_component_configs(
# Load the component's test file
comp_data = load_yaml_file(test_file)
# Validate packages are identical
# Validate packages are compatible
# Components with no packages (no_buses) can merge with any group
comp_packages = extract_packages_from_yaml(comp_data)
if all_packages is None:
# First component - set the baseline
all_packages = comp_packages
elif not comp_packages:
# This component has no packages (no_buses) - it can merge with any group
pass
elif not all_packages:
# Previous components had no packages, but this one does - adopt these packages
all_packages = comp_packages
elif comp_packages != all_packages:
# Both have packages but they differ - this is an error
raise ValueError(
f"Component {comp_name} has different packages than previous components. "
f"Expected: {all_packages}, Got: {comp_packages}. "