Add selectors for text and arbitrary objects (#16322)

This commit is contained in:
Thomas Lovén 2021-01-27 12:09:10 +01:00 committed by GitHub
parent 72cb1e2267
commit 588acc84aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 0 deletions

View File

@ -21,7 +21,9 @@ The following selectors are currently available:
- [Device selector](#device-selector) - [Device selector](#device-selector)
- [Entity selector](#entity-selector) - [Entity selector](#entity-selector)
- [Number selector](#number-selector) - [Number selector](#number-selector)
- [Object selector](#object-selector)
- [Target selector](#target-selector) - [Target selector](#target-selector)
- [Text selector](#text-selector)
- [Time selector](#time-selector) - [Time selector](#time-selector)
If no selector is defined, a text input for a single line will be shown. If no selector is defined, a text input for a single line will be shown.
@ -367,6 +369,18 @@ number:
mode: slider mode: slider
``` ```
## Object selector
The object selector can be used to input arbitrary data in YAML form. This is useful for e.g. lists and dictionaries like service data. The value of the input will contain the provided data.
![Screenshot of an object selector](/images/blueprints/selector-object.png)
This selector does not have any other options; therefore, it only has its key.
```yaml
object:
```
## Target selector ## Target selector
The target selector is a rather special selector, allowing the user to selector The target selector is a rather special selector, allowing the user to selector
@ -477,6 +491,26 @@ target:
model: TRADFRI remote control model: TRADFRI remote control
``` ```
## Text selector
The text selector can be used to input a text string. The value of the input will contain the selected text.
![Screenshot of a text selector](/images/blueprints/selector-text.png)
Unless `multiline` is set to `true`, this selector behaves exactly like if no selector at all was specified, and will display a single line text input box on the user interface.
```yaml
text:
```
{% configuration text %}
multiline:
description: Set to true to display the input as a multi-line text box on the user interface.
type: boolean
default: false
required: false
{% endconfiguration %}
## Time selector ## Time selector
The time selector shows a time input that allows the user to specify a time The time selector shows a time input that allows the user to specify a time

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB