mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 15:26:59 +00:00
Include documentation for recursive config include
This commit is contained in:
parent
0b3cec0338
commit
dbe8aa444a
@ -196,6 +196,22 @@ We offer four advanced options to include whole directories at once.
|
|||||||
- `!include_dir_merge_list` will return the content of a directory as a list by merging all files (which should contain a list) into 1 big list.
|
- `!include_dir_merge_list` will return the content of a directory as a list by merging all files (which should contain a list) into 1 big list.
|
||||||
- `!include_dir_merge_named` will return the content of a directory as a dictionary by loading each file and merging it into 1 big dictionary.
|
- `!include_dir_merge_named` will return the content of a directory as a dictionary by loading each file and merging it into 1 big dictionary.
|
||||||
|
|
||||||
|
These work recursively. As an example using `!include_dir_* automation`, will include all 6 files shown below:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
.
|
||||||
|
└── .homeassistant
|
||||||
|
├── automation
|
||||||
|
│ ├── lights
|
||||||
|
│ │ ├── turn_light_off_bedroom.yaml
|
||||||
|
│ │ ├── turn_light_off_lounge.yaml
|
||||||
|
│ │ ├── turn_light_on_bedroom.yaml
|
||||||
|
│ │ └── turn_light_on_lounge.yaml
|
||||||
|
│ ├── say_hello.yaml
|
||||||
|
│ └── sensors
|
||||||
|
│ └── react.yaml
|
||||||
|
└── configuration.yaml (not included)
|
||||||
|
```
|
||||||
|
|
||||||
#### {% linkable_title Example: `!include_dir_list` %}
|
#### {% linkable_title Example: `!include_dir_list` %}
|
||||||
|
|
||||||
@ -377,7 +393,6 @@ automation: !include_dir_merge_list automation/
|
|||||||
action:
|
action:
|
||||||
service: light.turn_on
|
service: light.turn_on
|
||||||
entity_id: light.entryway
|
entity_id: light.entryway
|
||||||
|
|
||||||
- alias: Automation 2
|
- alias: Automation 2
|
||||||
trigger:
|
trigger:
|
||||||
platform: state
|
platform: state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user