Skip to content
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

Add Bang & Olufsen custom action examples #36404

Merged
merged 7 commits into from
Dec 22, 2024

Conversation

mj23000
Copy link
Contributor

@mj23000 mj23000 commented Dec 17, 2024

Proposed change

Add usage examples to all custom Beolink actions, as well as some explanatory text where needed in the Bang & Olufsen integration.

This PR expands upon example action usage defined in #36174 which is why the next branch is used.

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

Summary by CodeRabbit

  • New Features
    • Expanded documentation for Bang & Olufsen integration with new actions: bang_olufsen.beolink_join, bang_olufsen.beolink_expand, bang_olufsen.beolink_unexpand, bang_olufsen.beolink_leave, and bang_olufsen.beolink_allstandby.
    • Added detailed examples for each action, including expected YAML format.
    • Improved organization and clarity of the documentation, including a refined limitations section regarding unsupported features.

@home-assistant home-assistant bot added has-parent This PR has a parent PR in a other repo next This PR goes into the next branch labels Dec 17, 2024
Copy link

netlify bot commented Dec 17, 2024

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 4ed7b42
🔍 Latest deploy log https://app.netlify.com/sites/home-assistant-docs/deploys/67628ee3d94a040008721a44
😎 Deploy Preview https://deploy-preview-36404--home-assistant-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

coderabbitai bot commented Dec 17, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request updates the Bang & Olufsen integration documentation for Home Assistant, specifically enhancing the section on custom actions related to Beolink. It introduces five new actions: bang_olufsen.beolink_join, bang_olufsen.beolink_expand, bang_olufsen.beolink_unexpand, bang_olufsen.beolink_leave, and bang_olufsen.beolink_allstandby. Each action is detailed with parameters and structured examples, while the limitations section has been refined. The overall organization of the documentation has been improved for clarity and usability.

Changes

File Change Summary
source/_integrations/bang_olufsen.markdown - Added documentation for new Beolink-related custom actions
- Expanded action descriptions with parameters and examples
- Refined limitations section for Mozart platform
- Improved overall documentation structure and clarity

Sequence Diagram

sequenceDiagram
    participant User
    participant HomeAssistant
    participant BeoDevice
    
    User->>HomeAssistant: Invoke Beolink Action
    alt Join Beolink
        HomeAssistant->>BeoDevice: bang_olufsen.beolink_join
    else Expand Beolink
        HomeAssistant->>BeoDevice: bang_olufsen.beolink_expand
    else Unexpand Beolink
        HomeAssistant->>BeoDevice: bang_olufsen.beolink_unexpand
    else Leave Beolink
        HomeAssistant->>BeoDevice: bang_olufsen.beolink_leave
    else All Standby
        HomeAssistant->>BeoDevice: bang_olufsen.beolink_allstandby
    end
Loading

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (4)
source/_integrations/bang_olufsen.markdown (4)

290-292: Fix compound word spelling

For consistency with the linked documentation, "multi-room" should be written as "multiroom".

-The Bang & Olufsen integration additionally supports different custom actions for Beolink. 
-
-[Beolink](https://support.bang-olufsen.com/hc/en-us/articles/4411572883089-What-is-Beolink-Multiroom) is Bang & Olufsen's advanced multi-room audio solution. This integration supports Home Assistant's `media_player` grouping, but to fully benefit from Beolink, such as being able to join legacy devices not added in Home Assistant, custom actions have been defined.
+The Bang & Olufsen integration additionally supports different custom actions for Beolink. 
+
+[Beolink](https://support.bang-olufsen.com/hc/en-us/articles/4411572883089-What-is-Beolink-Multiroom) is Bang & Olufsen's advanced multiroom audio solution. This integration supports Home Assistant's `media_player` grouping, but to fully benefit from Beolink, such as being able to join legacy devices not added in Home Assistant, custom actions have been defined.
🧰 Tools
🪛 LanguageTool

[misspelling] ~292-~292: This word is normally spelled as one.
Context: ...Multiroom) is Bang & Olufsen's advanced multi-room audio solution. This integration suppor...

(EN_COMPOUNDS_MULTI_ROOM)

🪛 Markdownlint (0.37.0)

290-290: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


324-324: Remove trailing punctuation from heading

Remove the colon from the heading to follow markdown style guidelines.

-##### Join a currently active beolink experience or device playing compatible source:
+##### Join a currently active beolink experience or device playing compatible source
🧰 Tools
🪛 Markdownlint (0.37.0)

324-324: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


366-366: Remove trailing punctuation from headings

Remove the colons from these headings to follow markdown style guidelines.

-##### Expand an active Beolink experience to all other devices discovered by the defined device:
+##### Expand an active Beolink experience to all other devices discovered by the defined device

-##### Expand an active Beolink experience to a specific device:
+##### Expand an active Beolink experience to a specific device

-##### Expand an active Beolink experience to specific devices:
+##### Expand an active Beolink experience to specific devices

Also applies to: 376-376, 398-398

🧰 Tools
🪛 Markdownlint (0.37.0)

366-366: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


430-430: Remove trailing punctuation from headings

Remove the colons from these headings to follow markdown style guidelines.

-##### Remove a device from an active Beolink experience:
+##### Remove a device from an active Beolink experience

-##### Remove devices from an active Beolink experience:
+##### Remove devices from an active Beolink experience

Also applies to: 441-441

🧰 Tools
🪛 Markdownlint (0.37.0)

430-430: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1db3f27 and 3a7e4c6.

📒 Files selected for processing (1)
  • source/_integrations/bang_olufsen.markdown (5 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/bang_olufsen.markdown

[misspelling] ~292-~292: This word is normally spelled as one.
Context: ...Multiroom) is Bang & Olufsen's advanced multi-room audio solution. This integration suppor...

(EN_COMPOUNDS_MULTI_ROOM)

🪛 Markdownlint (0.37.0)
source/_integrations/bang_olufsen.markdown

290-290: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


323-323: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


324-324: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


334-334: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


365-365: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


366-366: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


376-376: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


398-398: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


453-453: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


474-474: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


487-487: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


430-430: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


441-441: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)

🔇 Additional comments (4)
source/_integrations/bang_olufsen.markdown (4)

Line range hint 303-355: Documentation looks great!

The beolink_join documentation is comprehensive and well-structured:

  • Clear parameter descriptions
  • Good coverage of examples
  • Helpful platform compatibility table
🧰 Tools
🪛 Markdownlint (0.37.0)

323-323: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


324-324: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


334-334: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


365-421: Documentation looks great!

The beolink_expand documentation is thorough and well-structured:

  • Clear parameter descriptions
  • Good coverage of examples
  • Helpful explanation of media_player.join equivalence
🧰 Tools
🪛 Markdownlint (0.37.0)

365-365: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


366-366: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


376-376: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


398-398: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


430-473: Documentation looks great!

Both beolink_unexpand and beolink_leave documentation sections are well-structured:

  • Clear parameter descriptions
  • Good coverage of examples
  • Helpful explanation of media_player.unjoin equivalence
🧰 Tools
🪛 Markdownlint (0.37.0)

453-453: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


430-430: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


441-441: Punctuation: ':'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


479-486: Documentation looks great!

The beolink_allstandby documentation is concise and clear with a good example.

Change multi-room to multiroom
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
source/_integrations/bang_olufsen.markdown (3)

290-290: Remove trailing space

There's a trailing space at the end of line 290.

-The Bang & Olufsen integration additionally supports different custom actions for Beolink. 
+The Bang & Olufsen integration additionally supports different custom actions for Beolink.
🧰 Tools
🪛 Markdownlint (0.37.0)

290-290: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


Line range hint 303-355: Consider improving table readability

The documentation is comprehensive, but the source_id description in the action data table could be more readable if split into multiple rows or reformatted.

Consider restructuring like this:

| Action data attribute | Optional | Description |
| --------------------- | -------- | ------------ |
| `beolink_jid` | yes | Manually specify Beolink JID to join. |
| `source_id` | yes | Specify which source to join. Behavior varies between hardware platforms:<br>- Source names prefaced by platform name can only be used with that platform<br>- Example: "ASE Beoradio" only works with ASE devices<br>- Example: "ASE / Mozart Deezer" works with both ASE and Mozart devices<br>- A defined Beolink JID is required |
🧰 Tools
🪛 Markdownlint (0.37.0)

323-323: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


323-323: Fix consecutive blank lines

There are multiple instances of consecutive blank lines that should be reduced to a single blank line for consistent formatting.

Remove the extra blank lines at:

  • Line 323
  • Line 365
  • Line 453
  • Line 474
  • Line 487

Also applies to: 365-365, 453-453, 474-474, 487-487

🧰 Tools
🪛 Markdownlint (0.37.0)

323-323: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a7e4c6 and be3575a.

📒 Files selected for processing (1)
  • source/_integrations/bang_olufsen.markdown (5 hunks)
🧰 Additional context used
🪛 Markdownlint (0.37.0)
source/_integrations/bang_olufsen.markdown

290-290: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


323-323: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


365-365: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


453-453: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


474-474: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)


487-487: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)

🔇 Additional comments (1)
source/_integrations/bang_olufsen.markdown (1)

Line range hint 290-487: Documentation is well-structured and comprehensive

The documentation for Beolink custom actions is well-organized, with clear examples and good cross-referencing to standard Home Assistant actions. The platform compatibility information and various usage scenarios are thoroughly covered.

🧰 Tools
🪛 Markdownlint (0.37.0)

365-365: Expected: 1; Actual: 2
Multiple consecutive blank lines

(MD012, no-multiple-blanks)

Comment on lines 433 to 434
action: bang_olufsen.beolink_expand
target:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix incorrect action name in examples

The examples in the beolink_unexpand section incorrectly use bang_olufsen.beolink_expand instead of bang_olufsen.beolink_unexpand.

-action: bang_olufsen.beolink_expand
+action: bang_olufsen.beolink_unexpand

Also applies to: 444-445

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
source/_integrations/bang_olufsen.markdown (1)

Line range hint 293-354: Consider adding error handling information

While the documentation is comprehensive, it would be helpful to add information about:

  • What happens if the specified device is not available
  • How to handle connection timeouts
  • Common error scenarios and their solutions
🧰 Tools
🪛 LanguageTool

[uncategorized] ~301-~301: Possible missing comma found.
Context: ...d when connecting to that platform. For example "ASE Beoradio" can only be used when jo...

(AI_HYDRA_LEO_MISSING_COMMA)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be3575a and 6fd8598.

📒 Files selected for processing (1)
  • source/_integrations/bang_olufsen.markdown (5 hunks)
🔇 Additional comments (5)
source/_integrations/bang_olufsen.markdown (5)

290-292: LGTM!

The introduction clearly explains Beolink and its relationship with Home Assistant's media player grouping functionality.


Line range hint 355-419: LGTM!

The documentation effectively covers:

  • Parameter descriptions
  • Multiple usage examples
  • Equivalence with media_player.join action

Line range hint 420-450: LGTM!

The documentation correctly uses the action name bang_olufsen.beolink_unexpand in all examples, addressing the previous review comment.


455-470: LGTM!

The documentation clearly explains the action usage and its equivalence with media_player.unjoin.


475-482: LGTM!

The documentation provides a clear example for this straightforward action.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (2)
source/_integrations/bang_olufsen.markdown (2)

348-354: Improve table formatting consistency

The source compatibility table could be more readable with consistent formatting:

| Hardware platform       | Compatible source_ids                      |
| --------------------- | ------------------------------------------ |
-| ASE                     | `beoradio`                                 |
-| ASE and Mozart          | `deezer`, `spotify`                        |
-| Mozart                  | `tidal`                                    |
-| Beolink Converter NL/ML | `radio`, `tp1`, `tp2`, `cd`, `aux_a`, `ph` |
+| ASE                   | `beoradio`                                |
+| ASE and Mozart        | `deezer`, `spotify`                       |
+| Mozart                | `tidal`                                   |
+| Beolink Converter NL/ML| `radio`, `tp1`, `tp2`, `cd`, `aux_a`, `ph`|

475-482: Consider adding clarification about action scope

While the action is documented correctly, it would be helpful to clarify whether this affects only devices in the current Beolink experience or all discovered devices.

Set all connected Beolink devices to standby.
+
+This action will set all devices that are part of the current Beolink experience to standby mode.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6fd8598 and 4ed7b42.

📒 Files selected for processing (1)
  • source/_integrations/bang_olufsen.markdown (5 hunks)
🔇 Additional comments (4)
source/_integrations/bang_olufsen.markdown (4)

290-294: LGTM! Clear introduction to Beolink custom actions.

The introduction effectively explains Beolink's purpose and its relationship with Home Assistant's media player grouping functionality.


364-419: LGTM! Comprehensive documentation of beolink_expand action.

The documentation effectively covers all use cases with clear examples, including the relationship with the standard media_player.join action.


428-450: LGTM! Documentation correctly uses beolink_unexpand action name.

The examples and explanations are clear and accurate. Previous issues with action names have been resolved.


455-470: LGTM! Clear documentation of beolink_leave action.

The documentation effectively explains the action and its relationship with the standard media_player.unjoin action.

@frenck frenck added the parent-merged The parent PR has been merged already label Dec 22, 2024
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @mj23000 👍

../Frenck

@frenck frenck merged commit 247093d into home-assistant:next Dec 22, 2024
7 checks passed
@home-assistant home-assistant bot removed the parent-merged The parent PR has been merged already label Dec 22, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has-parent This PR has a parent PR in a other repo next This PR goes into the next branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants