1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-07 05:42:20 +01:00

[core] add support for custom platform (#7616)

Co-authored-by: Tomasz Duda <tomaszduda23@gmai.com>
This commit is contained in:
tomaszduda23
2025-01-23 00:06:07 +01:00
committed by GitHub
parent 5a103543c4
commit 0c032bc431
11 changed files with 57 additions and 22 deletions

View File

@@ -22,7 +22,6 @@ from esphome.const import (
CONF_PACKAGES,
CONF_PLATFORM,
CONF_SUBSTITUTIONS,
TARGET_PLATFORMS,
)
from esphome.core import CORE, DocumentRange, EsphomeError
import esphome.core.config as core_config
@@ -833,7 +832,7 @@ def validate_config(
result[CONF_ESPHOME] = config[CONF_ESPHOME]
result.add_output_path([CONF_ESPHOME], CONF_ESPHOME)
try:
core_config.preload_core_config(config, result)
target_platform = core_config.preload_core_config(config, result)
except vol.Invalid as err:
result.add_error(err)
return result
@@ -845,9 +844,9 @@ def validate_config(
cv.All(cv.version_number, cv.validate_esphome_version)(min_version)
# First run platform validation steps
for key in TARGET_PLATFORMS:
if key in config:
result.add_validation_step(LoadValidationStep(key, config[key]))
result.add_validation_step(
LoadValidationStep(target_platform, config[target_platform])
)
result.run_validation_steps()
if result.errors: