Skip to content

Commit

Permalink
Fix the get queue service
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Nov 8, 2024
1 parent f37c11f commit 6492806
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 21 deletions.
3 changes: 2 additions & 1 deletion custom_components/mass/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ async def handle_player_added(event: MassEvent) -> None:
platform.async_register_entity_service(
SERVICE_GET_QUEUE,
schema=None,
func="_async_handle_get_queue",
supports_response=SupportsResponse.ONLY,
)

Expand Down Expand Up @@ -543,7 +544,7 @@ async def _async_handle_transfer_queue(
)

@catch_musicassistant_error
async def handle_get_queue(self) -> ServiceResponse:
async def _async_handle_get_queue(self) -> ServiceResponse:
"""Handle get_queue action."""
if not self.active_queue:
raise HomeAssistantError("No active queue found")
Expand Down
12 changes: 6 additions & 6 deletions custom_components/mass/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ search:
boolean:

get_queue:
fields:
queue_id:
required: true
example: "00:11:22:33:44:55"
selector:
text:
target:
entity:
domain: media_player
integration: mass
supported_features:
- media_player.MediaPlayerEntityFeature.PLAY_MEDIA

get_library:
fields:
Expand Down
8 changes: 1 addition & 7 deletions custom_components/mass/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,7 @@
},
"get_queue": {
"name": "Get PlayerQueue details (advanced)",
"description": "Get the full queue details of a Music Assistant Queue.",
"fields": {
"queue_id": {
"name": "Queue ID",
"description": "The Music Assistant Queue ID to request details for."
}
}
"description": "Get the full details of the currently active queue of a Music Assistant player."
},
"get_library": {
"name": "Get Library items",
Expand Down
8 changes: 1 addition & 7 deletions custom_components/mass/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,7 @@
},
"get_queue": {
"name": "Get PlayerQueue details (advanced)",
"description": "Get the full queue details of a Music Assistant Queue.",
"fields": {
"queue_id": {
"name": "Queue ID",
"description": "The Music Assistant Queue ID to request details for."
}
}
"description": "Get the full details of the currently active queue of a Music Assistant player."
},
"get_library": {
"name": "Get Library items",
Expand Down

0 comments on commit 6492806

Please sign in to comment.