mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 22:48:10 +01:00
Fix command line substitutions without any yaml substitutions (#6644)
This commit is contained in:
parent
0ef7781bb3
commit
a700ae481d
15 changed files with 5 additions and 53 deletions
|
@ -116,7 +116,7 @@ def do_substitution_pass(config, command_line_substitutions, ignore_missing=Fals
|
|||
if CONF_SUBSTITUTIONS not in config and not command_line_substitutions:
|
||||
return
|
||||
|
||||
substitutions = config[CONF_SUBSTITUTIONS]
|
||||
substitutions = config.get(CONF_SUBSTITUTIONS)
|
||||
if substitutions is None:
|
||||
substitutions = command_line_substitutions
|
||||
elif command_line_substitutions:
|
||||
|
|
|
@ -756,11 +756,11 @@ def validate_config(
|
|||
CORE.raw_config = config
|
||||
|
||||
# 1. Load substitutions
|
||||
if CONF_SUBSTITUTIONS in config:
|
||||
if CONF_SUBSTITUTIONS in config or command_line_substitutions:
|
||||
from esphome.components import substitutions
|
||||
|
||||
result[CONF_SUBSTITUTIONS] = {
|
||||
**config[CONF_SUBSTITUTIONS],
|
||||
**config.get(CONF_SUBSTITUTIONS, {}),
|
||||
**command_line_substitutions,
|
||||
}
|
||||
result.add_output_path([CONF_SUBSTITUTIONS], CONF_SUBSTITUTIONS)
|
||||
|
|
|
@ -37,9 +37,9 @@ start_esphome() {
|
|||
|
||||
# Start esphome process
|
||||
echo "> [$target_component] [$test_name] [$target_platform]"
|
||||
echo "esphome -s component_name $target_component -s test_name $test_name -s target_platform $target_platform $esphome_command $component_test_file"
|
||||
echo "esphome -s component_name $target_component -s component_dir ../../components/$target_component -s test_name $test_name -s target_platform $target_platform $esphome_command $component_test_file"
|
||||
# TODO: Validate escape of Command line substitution value
|
||||
esphome -s component_name $target_component -s test_name $test_name -s target_platform $target_platform $esphome_command $component_test_file
|
||||
esphome -s component_name $target_component -s component_dir ../../components/$target_component -s test_name $test_name -s target_platform $target_platform $esphome_command $component_test_file
|
||||
}
|
||||
|
||||
# Find all test yaml files.
|
||||
|
|
|
@ -12,8 +12,4 @@ packages:
|
|||
component_under_test: !include
|
||||
file: $component_test_file
|
||||
vars:
|
||||
component_name: $component_name
|
||||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -14,8 +14,4 @@ packages:
|
|||
component_under_test: !include
|
||||
file: $component_test_file
|
||||
vars:
|
||||
component_name: $component_name
|
||||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -14,8 +14,4 @@ packages:
|
|||
component_under_test: !include
|
||||
file: $component_test_file
|
||||
vars:
|
||||
component_name: $component_name
|
||||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -14,8 +14,4 @@ packages:
|
|||
component_under_test: !include
|
||||
file: $component_test_file
|
||||
vars:
|
||||
component_name: $component_name
|
||||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -14,8 +14,4 @@ packages:
|
|||
component_under_test: !include
|
||||
file: $component_test_file
|
||||
vars:
|
||||
component_name: $component_name
|
||||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -15,8 +15,4 @@ packages:
|
|||
component_under_test: !include
|
||||
file: $component_test_file
|
||||
vars:
|
||||
component_name: $component_name
|
||||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -15,8 +15,4 @@ packages:
|
|||
component_under_test: !include
|
||||
file: $component_test_file
|
||||
vars:
|
||||
component_name: $component_name
|
||||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -15,8 +15,4 @@ packages:
|
|||
component_under_test: !include
|
||||
file: $component_test_file
|
||||
vars:
|
||||
component_name: $component_name
|
||||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -15,8 +15,4 @@ packages:
|
|||
component_under_test: !include
|
||||
file: $component_test_file
|
||||
vars:
|
||||
component_name: $component_name
|
||||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -12,8 +12,4 @@ packages:
|
|||
component_under_test: !include
|
||||
file: $component_test_file
|
||||
vars:
|
||||
component_name: $component_name
|
||||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -12,8 +12,4 @@ packages:
|
|||
component_under_test: !include
|
||||
file: $component_test_file
|
||||
vars:
|
||||
component_name: $component_name
|
||||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
|
@ -15,8 +15,4 @@ packages:
|
|||
component_under_test: !include
|
||||
file: $component_test_file
|
||||
vars:
|
||||
component_name: $component_name
|
||||
test_name: $test_name
|
||||
target_platform: $target_platform
|
||||
component_test_file: $component_test_file
|
||||
component_dir: "../../components/$component_name"
|
||||
|
|
Loading…
Reference in a new issue