mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 16:56:50 +00:00
Add fields and multiple support to object selector (#39655)
This commit is contained in:
parent
e4b7254f7f
commit
b167c81b7e
@ -1136,16 +1136,79 @@ number:
|
||||
|
||||
The object selector can be used to input arbitrary data in YAML form. This is useful for e.g. lists and dictionaries containing data for actions. The value of the input will contain the provided data.
|
||||
|
||||

|
||||
When used without options, the selector will accept a free form object.
|
||||
|
||||
This selector does not have any other options; therefore, it only has its key.
|
||||

|
||||
|
||||
```yaml
|
||||
object:
|
||||
```
|
||||
|
||||
When used with a `schema`, the selector will force the object to be in this format by displaying a form.
|
||||
|
||||

|
||||
|
||||
```yaml
|
||||
object:
|
||||
label_key: name
|
||||
description_key: percentage
|
||||
multiple: true
|
||||
fields:
|
||||
name:
|
||||
label: Name
|
||||
selector:
|
||||
text:
|
||||
percentage:
|
||||
label: Percentage
|
||||
selector:
|
||||
number:
|
||||
unit_of_measurement: "%"
|
||||
```
|
||||
|
||||
The output of this selector is a YAML object.
|
||||
|
||||
{% configuration qr_code %}
|
||||
fields:
|
||||
description: >
|
||||
List of fields of the object.
|
||||
type: map
|
||||
required: false
|
||||
keys:
|
||||
label:
|
||||
description: The label of the field
|
||||
required: false
|
||||
type: string
|
||||
selector:
|
||||
description: The selector to use for this field. It can be any available selector.
|
||||
required: true
|
||||
type: string
|
||||
label_field:
|
||||
description: >
|
||||
The field to use as a label. By default, it will be the first field defined. This option is only used if `fields` option set.
|
||||
type: string
|
||||
required: false
|
||||
description_field:
|
||||
description: >
|
||||
The field to use as a description. This option is only used if `fields` option set.
|
||||
type: string
|
||||
required: false
|
||||
translation_key:
|
||||
description: >
|
||||
Allows translations provided by an integration where `translation_key`
|
||||
is the translation key that is providing the selector option strings
|
||||
translation. See the documentation on
|
||||
[Backend Localization](https://developers.home-assistant.io/docs/internationalization/core/#selectors)
|
||||
for more information.
|
||||
type: string
|
||||
required: false
|
||||
multiple:
|
||||
description: >
|
||||
Allows selecting multiple options. If set to `true`, the resulting value of this selector will be a list instead of a single string value. This option is only used if `fields` option set.
|
||||
type: boolean
|
||||
required: false
|
||||
default: false
|
||||
{% endconfiguration %}
|
||||
|
||||
## QR code selector
|
||||
|
||||
The QR code selector shows a QR code. It has no return value.
|
||||
|
BIN
source/images/blueprints/selector-object-schema.png
Normal file
BIN
source/images/blueprints/selector-object-schema.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 7.9 KiB |
Loading…
x
Reference in New Issue
Block a user