Skip to content

[WOL] Add source ip for magic packet #38717

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

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

netmaxt3r
Copy link

@netmaxt3r netmaxt3r commented Apr 24, 2025

Proposed change

Add source ip option for wake_on_lan integration

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

Summary by CodeRabbit

  • Documentation
    • Updated Wake on LAN integration documentation to include a new optional parameter for specifying the network interface IP address when sending magic packets.

@home-assistant home-assistant bot added the current This PR goes into the current branch label Apr 24, 2025
Copy link

netlify bot commented Apr 24, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 3435b89
🔍 Latest deploy log https://app.netlify.com/sites/home-assistant-docs/deploys/680f34fa6035c20008b9f11f
😎 Deploy Preview https://deploy-preview-38717--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 Apr 24, 2025

📝 Walkthrough
## Walkthrough

The documentation for the Wake on LAN integration was updated to introduce an optional parameter named `if`, which allows users to specify the IP address of the network interface used to send magic packets. This new parameter is now described in the integration's basic configuration, the service action data attributes, and the switch platform configuration schema. No changes were made to other parameters or the integration's logic.

## Changes

| File                                         | Change Summary                                                                                 |
|----------------------------------------------|-----------------------------------------------------------------------------------------------|
| source/_integrations/wake_on_lan.markdown    | Added documentation for the new optional `if` parameter in configuration, service, and schema. |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant HomeAssistant
    participant NetworkInterface

    User->>HomeAssistant: Configure wake_on_lan with optional 'if' (interface IP)
    User->>HomeAssistant: Call send_magic_packet (with optional 'if')
    HomeAssistant->>NetworkInterface: Send magic packet via specified interface (if provided)
    NetworkInterface-->>HomeAssistant: Packet sent
    HomeAssistant-->>User: Confirmation/Result

</details>

<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

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

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between ce748f095a133563ef861d2d7b2931cf319bd5dd and 3435b897ab12925483d7a74151f9d3cc979b4710.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `source/_integrations/wake_on_lan.markdown` (3 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* source/_integrations/wake_on_lan.markdown

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAbQB1AHkAGQBdSABBWnpEfGwKBg94bkgAM3w+ZjQieAYeNAYAaxJcABpo+2wBZnUaejlIbERKSHJcKoAPXABmPjRkW1HHARHpgA4AdgBGDdaeCnxufGHkTEHuWmoPAjDYDwAJFg8MxEQkXExQ2nwGR3ZqeD4DAaGB3RiwTCkFAYXAHWjYQqnUYkADu/G44iBYXw9m4ongpXkuDBuXyhUgAEkrOhsv5XmUKrcPFUanVuA1mqF4FhiR4UWhmgB9IGCrxnbk0IhUTHA0GoNDZdSArBkCEYRFMhQYUrwIj5AFYhhodlqLxK6T8Uqa/lCkVirClEjUfIeA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PwdFmL7B9oHTTYdcmx1JvsJO6dgLgUEcudcppAs1VtIIBCjZPStmcD8GgPZMLnCHPGSoyZpyZkXMMPMh+v0nk0UFNXI69aKIUFCPUgwEWBDqRUkpAATEpDY0wstZemBsBg6k1ibRINdAAbLQBgAhKvqTQOpVStBpi0FKBsdSDBKvTBIAIMLqXGmMBIBsJSaxSjXSa2gLY0w1LdaLmsSrWxaBZdoBsAQWX1LTC2AwUoW31ICFoM1+gczBvTBUqpAQax1IbBUFsDbWXVKjdazdkbWxVJbFKOpFrDASsdYELlrY11+sDYgJF9Q0XECxd4fFwUzSwtAA=== -->

<!-- internal state end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=home-assistant/home-assistant.io&utm_content=38717):

- 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](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

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 (3)
source/_integrations/wake_on_lan.markdown (3)

39-41: Unify and clarify the basic config description.

The description could be more precise and consistent with other sections. For example:

 Interface IP address:
-  description: The IP address of the network adapter of HA instance to route the magic packet through.
+  description: The IP address of the Home Assistant instance’s network interface through which the magic packet is sent.

67-68: Fix grammar and improve service table entry.

“where magic packet is send” should be “where the magic packet is sent,” and the description can mirror the basic config. For example:

-| `if`                   | yes      | Optional HA interface IP address where magic packet is send.         |
+| `if`                   | yes      | Optional interface IP address of the Home Assistant instance through which the magic packet is sent. |
🧰 Tools
🪛 LanguageTool

[grammar] ~67-~67: Consider using either the past participle “sent” or the present participle “sending” here.
Context: ...erface IP address where magic packet is send. | Sample action data: ```jso...

(BEEN_PART_AGREEMENT)


133-136: Align the YAML schema description with other sections.

Use a unified phrasing and spell out “Home Assistant”:

if:
-  description: HA interface IP address where magic packet is routed.
+  description: The IP address of the Home Assistant instance’s network interface through which the magic packet is sent.
  required: false
  type: string
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9d8cbef and b943424.

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

[grammar] ~67-~67: Consider using either the past participle “sent” or the present participle “sending” here.
Context: ...erface IP address where magic packet is send. | Sample action data: ```jso...

(BEEN_PART_AGREEMENT)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - home-assistant-docs
  • GitHub Check: Header rules - home-assistant-docs
  • GitHub Check: Pages changed - home-assistant-docs

@home-assistant home-assistant bot added the has-parent This PR has a parent PR in a other repo label Apr 24, 2025
@home-assistant home-assistant bot added in-progress This PR/Issue is currently being worked on needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch labels Apr 24, 2025
@home-assistant
Copy link

It seems that this PR is targeted against an incorrect branch since it has a parent PR on one of our codebases. Documentation that needs to be updated for an upcoming release should target the next branch. Please change the target branch of this PR to next and rebase if needed.

@c0ffeeca7
Copy link
Contributor

Thank you for contributing, @netmaxt3r 👍

  • As this PR seems to be related to a code PR, please rebase and point this PR against the next branch.

@c0ffeeca7 c0ffeeca7 marked this pull request as draft April 28, 2025 06:25
@c0ffeeca7
Copy link
Contributor

I'm drafting this PR, as changes are needed. Please undraft it, once the changes have been implemented and the PR is ready for review again.

@netmaxt3r netmaxt3r changed the base branch from current to next April 28, 2025 06:57
@home-assistant home-assistant bot removed current This PR goes into the current branch needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch labels Apr 28, 2025
@home-assistant home-assistant bot added the next This PR goes into the next branch label Apr 28, 2025
@netmaxt3r netmaxt3r closed this Apr 28, 2025
@netmaxt3r netmaxt3r deleted the wol_interface branch April 28, 2025 07:07
@home-assistant home-assistant bot removed the in-progress This PR/Issue is currently being worked on label Apr 28, 2025
@netmaxt3r netmaxt3r restored the wol_interface branch April 28, 2025 07:11
@netmaxt3r
Copy link
Author

[ignore] restore deleted brach to reopen PR

@netmaxt3r netmaxt3r marked this pull request as ready for review April 28, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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