1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 22:53:59 +00:00

[substitutions] implement !literal (#10785)

This commit is contained in:
Javier Peletier
2025-09-22 06:32:59 +02:00
committed by GitHub
parent 68eb4091b8
commit 7629903afb
5 changed files with 30 additions and 9 deletions

View File

@@ -1,7 +1,11 @@
substitutions:
substituted: 99
var1: '1'
var2: '2'
var21: '79'
value: 33
values: 44
esphome:
name: test
test_list:
@@ -19,3 +23,6 @@ test_list:
- ${ undefined_var }
- key1: 1
key2: 2
- Literal $values ${are not substituted}
- ["list $value", "${is not}", "${substituted}"]
- {"$dictionary": "$value", "${is not}": "${substituted}"}

View File

@@ -2,9 +2,12 @@ esphome:
name: test
substitutions:
substituted: 99
var1: "1"
var2: "2"
var21: "79"
value: 33
values: 44
test_list:
- "$var1"
@@ -21,3 +24,6 @@ test_list:
- ${ undefined_var }
- key${var1}: 1
key${var2}: 2
- !literal Literal $values ${are not substituted}
- !literal ["list $value", "${is not}", "${substituted}"]
- !literal {"$dictionary": "$value", "${is not}": "${substituted}"}