This commit is contained in:
fakuivan 2024-05-07 09:25:04 +02:00 committed by GitHub
commit 898f6bf9e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 0 deletions

View File

@ -207,6 +207,31 @@ Two substitution passes are performed allowing compound replacements.
something:
test: ${bar_${foo}_value}
Additionally since version 2024.3.0, substitutions can be of any type besides strings, the only
requirements are that non-string values must not be interpolated or be used as keys.
.. code-block:: yaml
substitutions:
devicename: livingroom
upper_devicename: Livingroom
pin_schema:
number: D8
inverted: True
esphome:
name: $devicename
# ...
binary_sensor:
- platform: gpio
# interpolation allowed since ${upper_devicename} contains a string
name: ${upper_devicename} Binary input
# interpolation not allowed, but not needed since pin does not contain
# any other text than "$pin_schema"
pin: $pin_schema
# ...
.. _YAML-insertion-operator:
YAML insertion operator