Skip to content

Commit 9130b39

Browse files
committed
bump to 2.4.0
1 parent c025f97 commit 9130b39

File tree

3 files changed

+58
-2
lines changed

3 files changed

+58
-2
lines changed

README.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,53 @@ media_player:
7171
7272
### Services
7373
74-
#### Service media\_player.play\_media
74+
#### Service mopidy.get_search_result
75+
76+
*This service was originally developed by [Daniele Ricci](https://github.com/daniele-athome)*
77+
78+
Search media based on keywords and return them for use in a script or automation.
79+
80+
**Note:** One of the keyword fields **must** be used: `keyword`, `keyword_album`, `keyword_artist`, `keyword_genre` or `keyword_track_name`
81+
82+
|Service data attribute|Optional|Description|Example|
83+
|-|-|-|-|
84+
|`entity_id`|no|String or list of `entity_id`s to search and return the result to.| |
85+
|`exact`|yes|String. Should the search be an exact match|false|
86+
|`keyword`|yes|String. The keywords to search for. Will search all track fields.|Everlong|
87+
|`keyword_album`|yes|String. The keywords to search for in album titles.|From Mars to Sirius|
88+
|`keyword_artist`|yes|String. The keywords to search for in artists.|Queens of the Stoneage|
89+
|`keyword_genre`|yes|String. The keywords to search for in genres.|rock|
90+
|`keyword_track_name`|yes|String. The keywords to search for in track names.|Lazarus|
91+
|`source`|yes|String. URI sources to search. `local`, `spotify` and `tunein` are the only supported options. Make sure to have these extensions enabled on your Mopidy Server! Separate multiple sources with a comma (,).|local,spotify|
92+
93+
##### Example
94+
95+
```yaml
96+
script:
97+
search_and_play_music:
98+
fields:
99+
[...]
100+
sequence:
101+
- service: mopidy.get_search_result
102+
data:
103+
keyword_artist: "{{ keyword_artist }}"
104+
keyword_track_name: "{{ keyword_track_name }}"
105+
source: local
106+
target:
107+
entity_id: "{{ target }}"
108+
response_variable: music_tracks # service returns something and result will be put into this variable
109+
- if: "{{ music_tracks['media_player.music'].result|length > 0 }}"
110+
then:
111+
- service: media_player.play_media
112+
data:
113+
media_content_id: "{{ music_tracks['media_player.music'].result[0] }}"
114+
media_content_type: music
115+
enqueue: "{{ enqueue }}"
116+
target:
117+
entity_id: "{{ target }}"
118+
```
119+
120+
#### Service media_player.play_media
75121

76122
The `media_content_id` needs to be formatted according to the Mopidy URI scheme. These can be easily found using the *Developer tools*.
77123

@@ -133,6 +179,10 @@ proxying them through Home Assistant is very resource intensive,
133179
causing delays. Therefore, I have decided to not proxy the art when
134180
using the Media Library for the time being.
135181

182+
## Contributors
183+
184+
- [Daniele Ricci](https://github.com/daniele-athome)
185+
136186
## Testers
137187

138188
- [Jan Gutowski](https://github.com/Switch123456789)

custom_components/mopidy/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"requirements": [
1111
"mopidyapi>=1.1.0"
1212
],
13-
"version": "2.3.4",
13+
"version": "2.4.0",
1414
"zeroconf": [
1515
{
1616
"type": "_mopidy-http._tcp.local."

mopidy-CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.4.0] - 2024-10-04
9+
10+
## Added
11+
12+
- `get_search_result` service to look for tracks and return the result
13+
814
## [2.3.5] - 2024-05-29
915

1016
### Fixed

0 commit comments

Comments
 (0)