Add config block to media selector (#39696)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Paulus Schoutsen 2025-06-24 15:03:44 -04:00 committed by GitHub
parent c5a0d7c228
commit e39aa8dc73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1029,17 +1029,30 @@ You are prompted to select the device used to play media. Once the device is sel
![Screenshot of the Media selector](/images/blueprints/selector-media.png)
To ask the user to select a media device and suitable media, you can use the
media selector without any options:
```yaml
media:
```
You can also use the media selector with an optional `accept` filter to limit the
media types that can be selected. The user will not be asked to pick a device.
```yaml
# Do not ask for a device but manually specify a filter for the media.
media:
accept:
- image/*
```
{% configuration media %}
accept:
description: >
List of media types the user is allowed to select.
type: list
required: false
{% endconfiguration %}
The output of the media selector, is an mapping with information about
the selected media device and the selected media to play. There is also
metadata, which is used by the frontend and should not be used in the
@ -1181,7 +1194,7 @@ object:
fields:
name:
label: Name
selector:
selector:
text:
percentage:
label: Percentage