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

Don't remove location information for packages (#1133)

This commit is contained in:
Otto Winter
2020-07-15 15:27:24 +02:00
committed by GitHub
parent dcadcdf056
commit 4752096520
5 changed files with 33 additions and 41 deletions

View File

@@ -11,10 +11,8 @@ from contextlib import contextmanager
import voluptuous as vol
from esphome import core, core_config, yaml_util
from esphome.components import substitutions
from esphome.components.packages import do_packages_pass
from esphome.components.substitutions import CONF_SUBSTITUTIONS
from esphome.const import CONF_ESPHOME, CONF_PLATFORM, ESP_PLATFORMS, CONF_PACKAGES
from esphome.const import CONF_ESPHOME, CONF_PLATFORM, ESP_PLATFORMS, CONF_PACKAGES, \
CONF_SUBSTITUTIONS
from esphome.core import CORE, EsphomeError # noqa
from esphome.helpers import color, indent
from esphome.util import safe_print, OrderedDict
@@ -393,9 +391,10 @@ def validate_config(config, command_line_substitutions):
# 0. Load packages
if CONF_PACKAGES in config:
from esphome.components.packages import do_packages_pass
result.add_output_path([CONF_PACKAGES], CONF_PACKAGES)
try:
do_packages_pass(config)
config = do_packages_pass(config)
except vol.Invalid as err:
result.update(config)
result.add_error(err)
@@ -403,6 +402,7 @@ def validate_config(config, command_line_substitutions):
# 1. Load substitutions
if CONF_SUBSTITUTIONS in config:
from esphome.components import substitutions
result[CONF_SUBSTITUTIONS] = {**config[CONF_SUBSTITUTIONS], **command_line_substitutions}
result.add_output_path([CONF_SUBSTITUTIONS], CONF_SUBSTITUTIONS)
try: