mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-01-28 22:42:05 +01:00
fix !extend example (#3390)
This commit is contained in:
parent
e59d1dd3e9
commit
246b11a1aa
@ -331,20 +331,6 @@ your configuration file. This can be used to create generic 'template' configura
|
|||||||
files (like the ``example.yaml`` above) which can be used for multiple devices,
|
files (like the ``example.yaml`` above) which can be used for multiple devices,
|
||||||
using substitutions which are provided on the command line.
|
using substitutions which are provided on the command line.
|
||||||
|
|
||||||
Extend
|
|
||||||
------
|
|
||||||
|
|
||||||
To make changes or add additional configuration to included configurations ``!extend config_id`` can be used, where ``config_id`` is the ID of the configuration to modify.
|
|
||||||
For example to set a specific update interval on a common uptime sensor that is shared between configurations:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
<<: !include common.yaml
|
|
||||||
|
|
||||||
sensor:
|
|
||||||
- id: !extend uptime_sensor
|
|
||||||
update_interval: 10s
|
|
||||||
|
|
||||||
.. _config-packages:
|
.. _config-packages:
|
||||||
|
|
||||||
Packages
|
Packages
|
||||||
@ -543,6 +529,21 @@ platform, it could be constructed like this:
|
|||||||
- switch.turn_off: open_${door_location}_door_switch
|
- switch.turn_off: open_${door_location}_door_switch
|
||||||
- switch.turn_off: close_${door_location}_door_switch
|
- switch.turn_off: close_${door_location}_door_switch
|
||||||
|
|
||||||
|
Extend
|
||||||
|
------
|
||||||
|
|
||||||
|
To make changes or add additional configuration to included configurations ``!extend config_id`` can be used, where ``config_id`` is the ID of the configuration to modify.
|
||||||
|
For example to set a specific update interval on a common uptime sensor that is shared between configurations:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
packages:
|
||||||
|
common: !include common.yaml
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
- id: !extend uptime_sensor
|
||||||
|
update_interval: 10s
|
||||||
|
|
||||||
|
|
||||||
See Also
|
See Also
|
||||||
--------
|
--------
|
||||||
|
Loading…
Reference in New Issue
Block a user