Clarify that nested includes are indeed possible (#20349)

This commit is contained in:
akloeckner 2021-11-29 13:38:06 +01:00 committed by GitHub
parent 9887aba91f
commit 927dbf0432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,9 @@ switch: !include switch.yaml
device_tracker: !include device_tracker.yaml device_tracker: !include device_tracker.yaml
``` ```
Nesting `!include`s (having an `!include` within a file that is itself `!include`d) isn't going to work. You can, however, have multiple top-level `!include`s for a given integration, if you give a different label to each one: Nesting `!include`s (having an `!include` within a file that is itself `!include`d) will also work.
You can, as well, have multiple top-level `!include`s for a given integration, if you give a different label to each one:
```yaml ```yaml
light: light:
@ -198,6 +200,8 @@ If you have many configuration files, Home Assistant provides a CLI that allows
We offer four advanced options to include whole directories at once. Please note that your files must have the `.yaml` file extension; `.yml` is not supported. We offer four advanced options to include whole directories at once. Please note that your files must have the `.yaml` file extension; `.yml` is not supported.
This will allow you to `!include` files with `.yml` extensions from within the `.yaml` files; without those `.yml` files being imported by the following commands themselves.
- `!include_dir_list` will return the content of a directory as a list with each file content being an entry in the list. The list entries are ordered based on the alphanumeric ordering of the names of the files. - `!include_dir_list` will return the content of a directory as a list with each file content being an entry in the list. The list entries are ordered based on the alphanumeric ordering of the names of the files.
- `!include_dir_named` will return the content of a directory as a dictionary which maps filename => content of file. - `!include_dir_named` will return the content of a directory as a dictionary which maps filename => content of file.
- `!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.