mirror of
https://github.com/esphome/esphome.git
synced 2025-09-07 13:52:20 +01:00
image: allow the image to by auto-loaded by animation (#5139)
This commit is contained in:
@@ -39,6 +39,17 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def iter_components(config):
|
||||
for domain, conf in config.items():
|
||||
component = get_component(domain)
|
||||
yield domain, component
|
||||
if component.is_platform_component:
|
||||
for p_config in conf:
|
||||
p_name = f"{domain}.{p_config[CONF_PLATFORM]}"
|
||||
platform = get_platform(domain, p_config[CONF_PLATFORM])
|
||||
yield p_name, platform
|
||||
|
||||
|
||||
def iter_component_configs(config):
|
||||
for domain, conf in config.items():
|
||||
component = get_component(domain)
|
||||
if component.multi_conf:
|
||||
@@ -303,8 +314,10 @@ class LoadValidationStep(ConfigValidationStep):
|
||||
# Ignore top-level keys starting with a dot
|
||||
return
|
||||
result.add_output_path([self.domain], self.domain)
|
||||
result[self.domain] = self.conf
|
||||
component = get_component(self.domain)
|
||||
if component.multi_conf_no_default and isinstance(self.conf, core.AutoLoad):
|
||||
self.conf = []
|
||||
result[self.domain] = self.conf
|
||||
path = [self.domain]
|
||||
if component is None:
|
||||
result.add_str_error(f"Component not found: {self.domain}", path)
|
||||
@@ -424,7 +437,10 @@ class MetadataValidationStep(ConfigValidationStep):
|
||||
|
||||
def run(self, result: Config) -> None:
|
||||
if self.conf is None:
|
||||
result[self.domain] = self.conf = {}
|
||||
if self.comp.multi_conf and self.comp.multi_conf_no_default:
|
||||
result[self.domain] = self.conf = []
|
||||
else:
|
||||
result[self.domain] = self.conf = {}
|
||||
|
||||
success = True
|
||||
for dependency in self.comp.dependencies:
|
||||
|
Reference in New Issue
Block a user