-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Add actions to Music Assistant #36469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request updates the Music Assistant integration documentation by introducing three new actions: Changes
Sequence DiagramsequenceDiagram
participant User
participant MusicAssistant
participant Library
User->>MusicAssistant: music_assistant.search
MusicAssistant->>Library: Perform global search
Library-->>MusicAssistant: Return search results
MusicAssistant-->>User: Display search results
User->>MusicAssistant: music_assistant.get_library
MusicAssistant->>Library: Retrieve local library content
Library-->>MusicAssistant: Return library items
MusicAssistant-->>User: Show library contents
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
source/_integrations/music_assistant.markdown (3)
144-144
: Fix grammar in descriptionThere's a minor grammatical error in the description.
- - **Description**: The Music Assistant instance that the searched will be performed upon. Allows for multiple servers to be running. + - **Description**: The Music Assistant instance that the search will be performed upon. Allows for multiple servers to be running.
185-185
: Add missing comma in descriptionAdd a comma after "selected" for better readability.
- - **Description**: When selected only items marked as favorites will be returned. + - **Description**: When selected, only items marked as favorites will be returned.🧰 Tools
🪛 LanguageTool
[uncategorized] ~185-~185: Possible missing comma found.
Context: ...ional**: Yes. - Description: When selected only items marked as favorites will be ...(AI_HYDRA_LEO_MISSING_COMMA)
200-202
: Enhance the order_by parameter documentationThe reference to Developer Tools could be more specific to help users locate the options.
- - **Description**: Sort the list by this field. The options are numerous so inspect them in the Developer Tools, Actions tab. + - **Description**: Sort the list by this field. View available sorting options in the Developer Tools > Services > music_assistant.get_library action.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
source/_integrations/music_assistant.markdown
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/music_assistant.markdown
[uncategorized] ~185-~185: Possible missing comma found.
Context: ...ional**: Yes. - Description: When selected only items marked as favorites will be ...
(AI_HYDRA_LEO_MISSING_COMMA)
🔇 Additional comments (3)
source/_integrations/music_assistant.markdown (3)
138-170
: LGTM! Well-documented search action
The documentation for the music_assistant.search
action is comprehensive and follows the established pattern. All parameters are clearly documented with good examples.
212-220
: LGTM! Clear and concise queue action documentation
The documentation for the music_assistant.get_queue
action is well-structured and provides all necessary information.
138-220
: Verify integration with Home Assistant Core
The documentation aligns well with the PR objectives. Let's verify the action names match those in the core implementation.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~185-~185: Possible missing comma found.
Context: ...ional**: Yes. - Description: When selected only items marked as favorites will be ...
(AI_HYDRA_LEO_MISSING_COMMA)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
source/_integrations/music_assistant.markdown (3)
138-170
: Consider documenting the response format.The documentation for the
music_assistant.search
action is well-structured, but it would be helpful to include information about the expected response format. This would help users understand what data they'll receive and how to handle it in their automations.Consider adding a section like:
- **Example**: `true` + - **Example**: `true` + +#### Response format + +The action returns a dictionary containing search results grouped by media type: +```yaml +{ + "tracks": [...], + "albums": [...], + "artists": [...], + "playlists": [...], + "radio": [...] +} +```
199-202
: List available order_by options in the documentation.Instead of directing users to check Developer Tools for available sorting options, it would be more user-friendly to list them directly in the documentation.
Consider expanding the documentation like:
- **Description**: Sort the list by this field. View available sorting options in the Developer Tools > Actions > music_assistant.get_library action. + **Description**: Sort the list by this field. Available options: + - For tracks: name, artist, album, duration, year + - For albums: name, artist, year + - For artists: name + - For playlists: name, owner + - For radio: name
212-220
: Enhance the get_queue action documentation.The documentation for the
music_assistant.get_queue
action could be more comprehensive. Consider adding:
- The response format and structure
- Any optional parameters if they exist
- Example response payload
Consider expanding the documentation like:
- **Example**: `media_player.kitchen_speaker` + #### Response format + + The action returns the queue details including: + ```yaml + { + "current_item": {...}, # Currently playing item + "items": [...], # List of queued items + "total_items": 10, # Total number of items in queue + "current_index": 0 # Index of current item + } + ```
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
source/_integrations/music_assistant.markdown
(1 hunks)
🔇 Additional comments (1)
source/_integrations/music_assistant.markdown (1)
138-220
: Documentation looks good overall!
The documentation for the three new actions is well-structured, follows Home Assistant's documentation style, and provides clear examples. The suggested improvements above would enhance the documentation further, but the current version is already valuable and ready to be merged.
One thing I'm not sure of is if we should also add the expected output as these actions have return values. @frenck ? |
I think that would be a nice bonus @marcelveldt, but that can also be a follow up PR (considering beta cut is around the corner). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @OzGav !
@c0ffeeca7 any idea why this change doesnt show up in the current stable docs ? |
|
Proposed change
Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
current
branch.next
branch.Summary by CodeRabbit
music_assistant.search
action for global media searches with various customizable attributes.music_assistant.get_library
action for local library searches with enhanced filtering options.music_assistant.get_queue
action for retrieving the current media queue.