1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

Merge branch 'platform_normalize_too_late' into integration

This commit is contained in:
J. Nick Koston
2025-09-26 16:17:33 -05:00
5 changed files with 181 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