mirror of
https://github.com/esphome/esphome.git
synced 2025-02-22 04:48:21 +00:00
[config] Early check for required version (#8000)
This commit is contained in:
parent
f1712cffa8
commit
bd17ee8e33
@ -18,6 +18,7 @@ from esphome.const import (
|
|||||||
CONF_ESPHOME,
|
CONF_ESPHOME,
|
||||||
CONF_EXTERNAL_COMPONENTS,
|
CONF_EXTERNAL_COMPONENTS,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
|
CONF_MIN_VERSION,
|
||||||
CONF_PACKAGES,
|
CONF_PACKAGES,
|
||||||
CONF_PLATFORM,
|
CONF_PLATFORM,
|
||||||
CONF_SUBSTITUTIONS,
|
CONF_SUBSTITUTIONS,
|
||||||
@ -839,6 +840,10 @@ def validate_config(
|
|||||||
# Remove temporary esphome config path again, it will be reloaded later
|
# Remove temporary esphome config path again, it will be reloaded later
|
||||||
result.remove_output_path([CONF_ESPHOME], CONF_ESPHOME)
|
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
|
# First run platform validation steps
|
||||||
for key in TARGET_PLATFORMS:
|
for key in TARGET_PLATFORMS:
|
||||||
if key in config:
|
if key in config:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user