8000 Add config block to media selector · home-assistant/home-assistant.io@00d72c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 00d72c9

Browse files
committed
Add config block to media selector
1 parent c5a0d7c commit 00d72c9

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

source/_docs/blueprint/selectors.markdown

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ The following selectors are currently available:
5252
- [Theme selector](#theme-selector)
5353
- [Time selector](#time-selector)
5454
- [Trigger selector](#trigger-selector)
55+
- [Example - Merging with existing triggers](#example---merging-with-existing-triggers)
5556

5657
Interactive demos of each of these selectors can be found on the
5758
[Home Assistant Design portal](https://design.home-assistant.io/#components/ha-selector).
@@ -1029,17 +1030,30 @@ You are prompted to select the device used to play media. Once the device is sel
10291030

10301031
![Screenshot of the Media selector](/images/blueprints/selector-media.png)
10311032

1033+
To ask the user to select a media device and suitable media, you can use the
1034+
media selector without any options:
1035+
10321036
```yaml
10331037
media:
10341038
```
10351039

1040+
You can also use the media selector with an optional `accept` filter to limit the
1041+
media types that can be selected. The user will not be asked to pick a device.
1042+
10361043
```yaml
1037-
# Do not ask for a device but manually specify a filter for the media.
10381044
media:
10391045
accept:
10401046
- image/*
10411047
```
10421048

1049+
{% configuration area %}
1050+
accept:
1051+
description: >
1052+
List of media types the user is allowed to select.
1053+
type: list
1054+
required: false
1055+
{% endconfiguration %}
1056+
10431057
The output of the media selector, is an mapping with information about
10441058
the selected media device and the selected media to play. There is also
10451059
metadata, which is used by the frontend and should not be used in the
@@ -1181,7 +1195,7 @@ object:
11811195
fields:
11821196
name:
11831197
label: Name
1184-
selector:
1198+
selector:
11851199
text:
11861200
percentage:
11871201
label: Percentage

0 commit comments

Comments
 (0)
0