Add label selector (#32129)

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
Franck Nijhof 2024-04-02 14:48:18 +02:00
parent 16377da3b6
commit d1d22f346d
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
2 changed files with 38 additions and 0 deletions

View File

@ -35,6 +35,7 @@ The following selectors are currently available:
- [Entity selector](#entity-selector)
- [Floor selector](#floor-selector)
- [Icon selector](#icon-selector)
- [Label selector](#label-selector)
- [Language selector](#language-selector)
- [Location selector](#location-selector)
- [Media selector](#media-selector)
@ -886,6 +887,43 @@ placeholder:
The output of this selector is a string containing the selected icon,
for example: `mdi:bell`.
## Label selector
The label selector shows a label finder that can pick labels. The value of the
input is the label ID. If `multiple` is set to `true`, the value is a list
of label IDs.
![Screenshot of the label selector](/images/blueprints/selector-label.png)
In its most basic form, this selector doesn't require any options.
It will show all labels.
```yaml
label:
```
{% configuration text %}
multiple:
description: >
Allows selecting multiple labels. If set to `true`, the resulting value of
this selector will be a list instead of a single string value.
type: boolean
default: false
required: false
{% endconfiguration %}
The output of this selector is the label ID, or (in case `multiple` is set to
`true`) a list of label IDs.
```yaml
# Example label selector output result, when multiple is set to false
energy_saving
# Example label selector output result, when multiple is set to true
- energy_saving
- christmas_decorations
```
## Language selector
The language selector allows a user to pick a language from a list of languages.

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB