Added example of list (#1633)

Adds documentation on how to use a list to get specific numbers for an intent, like 100 % from the word maximum and how this can be used to set brightness of a light.
This commit is contained in:
Robin-St 2023-01-18 00:02:40 +01:00 committed by GitHub
parent 60ab5b6c62
commit b8c4752e3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,18 @@ lists:
to: 100 to: 100
``` ```
Specific numbers can also be matched by a list, like returning 100 from the keyword maximum. To use this list to set the brightness in a sentence, use the following syntax: `{brightness_level:brightness}`. This will get the value from the list but put it in the slot for brightness.
```yaml
lists:
brightness_level:
values:
- in: (max | maximum | highest)
out: 100
- in: ( minimum | lowest)
out: 1
```
### Expansion Rules ### Expansion Rules
A lot of template sentences can be written in a similar way. To avoid having to repeat the same matching structure multiple times, we can define expansion rules. For example, a user might add "the" in front of the area name, or they might not. We can define an expansion rule to match both cases. A lot of template sentences can be written in a similar way. To avoid having to repeat the same matching structure multiple times, we can define expansion rules. For example, a user might add "the" in front of the area name, or they might not. We can define an expansion rule to match both cases.