Document new accept keyword for the media selector (#39692)

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
Paulus Schoutsen 2025-06-24 11:36:34 -04:00 committed by GitHub
parent 29272d9cc0
commit d8d5c98836
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1025,8 +1025,7 @@ The media selector is a powerful selector that allows a user to easily select
media to play on a media device. Media can be a lot of things, for example,
cameras, local media, text-to-speech, Home Assistant Dashboards, and many more.
The user selects the device to play media on, and automatically limits the
selectable media suitable for the selected device.
You are prompted to select the device used to play media. Once the device is selected, the media selector only shows media that is suitable for this device.
![Screenshot of the Media selector](/images/blueprints/selector-media.png)
@ -1034,6 +1033,13 @@ selectable media suitable for the selected device.
media:
```
```yaml
# Do not ask for a device but manually specify a filter for the media.
media:
accept:
- image/*
```
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
@ -1059,6 +1065,25 @@ metadata:
media-source://tts/cloud?message=TTS+Message&language=en-US&gender=female
```
Example output if accept filter is used. Note that the `entity_id` is not present:
```yaml
media_content_id: media-source://tts/cloud?message=TTS+Message&language=en-US&gender=female
media_content_type: provider
metadata:
title: TTS Message
thumbnail: https://brands.home-assistant.io/_/cloud/logo.png
media_class: app
children_media_class: null
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://tts
- media_content_type: provider
media_content_id: >-
media-source://tts/cloud?message=TTS+Message&language=en-US&gender=female
```
## Number selector
The number selector shows either a number input or a slider input, that allows