Expose media_player async_browse_media as service#116452
Expose media_player async_browse_media as service#116452frenck merged 23 commits intohome-assistant:devfrom
Conversation
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
This PR is changing our entity model. Before we can review this PR there needs to be approval in a discussion in our architecture repository. https://github.com/home-assistant/architecture/discussions https://developers.home-assistant.io/docs/core/entity#changing-the-entity-model |
|
Architecture discussion is here |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
|
Can this be merged? |
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
|
Are we ready to merge? Please press the ready for review button when ready. |
Proposed change
Expose the existing media_player.async_browse_media method as a service call with a return value.
Approved architecture discussion: home-assistant/architecture#1079
The purpose is to allow automations to access the service to browse for media (just as you can do from the UI) and then use the return values to do other actions. As an example, here is an automation that gets a list of the albums by the Beatles and randomly plays one. This is using a Sonos music library.
Here is a sample of the YAML returned when running the browse_media service from developer tools / services
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: