1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 22:53:59 +00:00

[core] Fix platform component normalization happening too late in validation pipeline

This commit is contained in:
J. Nick Koston
2025-09-26 16:05:34 -05:00
parent 1560b8b8e2
commit 303b47cf00
5 changed files with 330 additions and 6 deletions

View File

@@ -382,6 +382,12 @@ class LoadValidationStep(ConfigValidationStep):
result.add_str_error(f"Component not found: {self.domain}", path)
return
CORE.loaded_integrations.add(self.domain)
# For platform components, normalize conf before creating MetadataValidationStep
if component.is_platform_component:
if not self.conf:
result[self.domain] = self.conf = []
elif not isinstance(self.conf, list):
result[self.domain] = self.conf = [self.conf]
# Process AUTO_LOAD
for load in component.auto_load:
@@ -399,12 +405,6 @@ class LoadValidationStep(ConfigValidationStep):
# Remove this is as an output path
result.remove_output_path([self.domain], self.domain)
# Ensure conf is a list
if not self.conf:
result[self.domain] = self.conf = []
elif not isinstance(self.conf, list):
result[self.domain] = self.conf = [self.conf]
for i, p_config in enumerate(self.conf):
path = [self.domain, i]
# Construct temporary unknown output path