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

Skip to content 8000

Commit 41e7b81

Browse files
committed
Add config block to media selector
1 parent c5a0d7c commit 41e7b81

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

source/_docs/blueprint/selectors.markdown

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,17 +1029,30 @@ You are prompted to select the device used to play media. Once the device is sel
10291029

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

1032+
To ask the user to select a media device and suitable media, you can use the
1033+
media selector without any options:
1034+
10321035
```yaml
10331036
media:
10341037
```
10351038

1039+
You can also use the media selector with an optional `accept` filter to limit the
1040+
media types that can be selected. The user will not be asked to pick a device.
1041+
10361042
```yaml
1037-
# Do not ask for a device but manually specify a filter for the media.
10381043
media:
10391044
accept:
10401045
- image/*
10411046
```
10421047

1048+
{% configuration area %}
1049+
accept:
1050+
description: >
1051+
List of media types the user is allowed to select.
1052+
type: list
1053+
required: false
1054+
{% endconfiguration %}
1055+
10431056
The output of the media selector, is an mapping with information about
10441057
the selected media device and the selected media to play. There is also
10451058
metadata, which is used by the frontend and should not be used in the
@@ -1181,7 +1194,7 @@ object:
11811194
fields:
11821195
name:
11831196
label: Name
1184-
selector:
1197+
selector:
11851198
text:
11861199
percentage:
11871200
label: Percentage

0 commit comments

Comments
 (0)
0