mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 16:56:50 +00:00
Add config block to media selector (#39696)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
c5a0d7c228
commit
e39aa8dc73
@ -1029,17 +1029,30 @@ You are prompted to select the device used to play media. Once the device is sel
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
To ask the user to select a media device and suitable media, you can use the
|
||||||
|
media selector without any options:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
media:
|
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
|
```yaml
|
||||||
# Do not ask for a device but manually specify a filter for the media.
|
|
||||||
media:
|
media:
|
||||||
accept:
|
accept:
|
||||||
- image/*
|
- 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 output of the media selector, is an mapping with information about
|
||||||
the selected media device and the selected media to play. There is also
|
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
|
metadata, which is used by the frontend and should not be used in the
|
||||||
@ -1181,7 +1194,7 @@ object:
|
|||||||
fields:
|
fields:
|
||||||
name:
|
name:
|
||||||
label: Name
|
label: Name
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
percentage:
|
percentage:
|
||||||
label: Percentage
|
label: Percentage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user