mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-13 20:36:29 +00:00
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:
parent
60ab5b6c62
commit
b8c4752e3b
@ -86,6 +86,18 @@ lists:
|
||||
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
|
||||
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user