mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 09:18:00 +01:00
proceed vars always, because of the defaults
This commit is contained in:
parent
285e82e5fc
commit
856087b7c1
1 changed files with 4 additions and 4 deletions
|
@ -121,6 +121,7 @@ def _process_base_package(config: dict) -> dict:
|
|||
password=config.get(CONF_PASSWORD),
|
||||
)
|
||||
files = []
|
||||
|
||||
for file in config[CONF_FILES]:
|
||||
if isinstance(file, str):
|
||||
files.append({CONF_NAME: file, CONF_VARS: {}})
|
||||
|
@ -132,7 +133,7 @@ def _process_base_package(config: dict) -> dict:
|
|||
for idx, file in enumerate(files):
|
||||
filename = file[CONF_NAME]
|
||||
yaml_file: Path = repo_dir / filename
|
||||
vars = file.get(CONF_VARS)
|
||||
vars = file.get(CONF_VARS, {})
|
||||
|
||||
if not yaml_file.is_file():
|
||||
raise cv.Invalid(
|
||||
|
@ -153,9 +154,8 @@ def _process_base_package(config: dict) -> dict:
|
|||
raise cv.Invalid(
|
||||
f"Current ESPHome Version is too old to use this package: {ESPHOME_VERSION} < {min_version}"
|
||||
)
|
||||
if vars:
|
||||
vars = {k: str(v) for k, v in vars.items()}
|
||||
new_yaml = yaml_util.substitute_vars(new_yaml, vars)
|
||||
vars = {k: str(v) for k, v in vars.items()}
|
||||
new_yaml = yaml_util.substitute_vars(new_yaml, vars)
|
||||
packages[f"{filename}{idx}"] = new_yaml
|
||||
except EsphomeError as e:
|
||||
raise cv.Invalid(
|
||||
|
|
Loading…
Reference in a new issue