[config] Early check for required version (#8000)

This commit is contained in:
Clyde Stubbs 2025-01-13 05:50:13 +11:00 committed by GitHub
parent f1712cffa8
commit bd17ee8e33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,6 +18,7 @@ from esphome.const import (
CONF_ESPHOME,
CONF_EXTERNAL_COMPONENTS,
CONF_ID,
CONF_MIN_VERSION,
CONF_PACKAGES,
CONF_PLATFORM,
CONF_SUBSTITUTIONS,
@ -839,6 +840,10 @@ def validate_config(
# Remove temporary esphome config path again, it will be reloaded later
result.remove_output_path([CONF_ESPHOME], CONF_ESPHOME)
# Check version number now to avoid loading components that are not supported
if min_version := config[CONF_ESPHOME].get(CONF_MIN_VERSION):
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: