-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Fix wake_on_lan ping with None as host #6532
Conversation
With the new update, wake_on_lan requires a host key in the configuration
I'm marking this as a breaking change, even though someone else made it break. We need to remember to update the docs, and mention this when released. |
Now the question is if we should retain the old behavior where host is optional. I'm thinking we don't need to have it required now since the code will work passing a stringified |
Yeah that would make sense, making it required would be considered a breaking change, and casting it to a string wouldn't break anything if it wasn't there. |
Thanks! Updated the PR title to reflect latest changes. |
Cherry-picked for 0.40.1 |
* Update configuration validation With the new update, wake_on_lan requires a host key in the configuration * cast self._host to str as requested * Changed host key back to optional
@brianjking having a host is still optional after this merge, we just changed how it is handled on the backend. So updating documentation is not necessary, and I closed the documentation PR. |
Why is the external ping command executed at all if host is None? |
Because WOL only needs a Mac address to work, the host entry is to be able to verify if the host is woken up (by pinging it, and with ping you need a host IP to ping) |
Yes, WoL needs only a Mac to wake the host, but as you said, for pinging the host you also need the IP. My point is, if host is None (no IP), there is no need to ping at all, so the code should IMHO be changed to skip the execution of the ping command in this case. |
With the new update, wake_on_lan requires a host key in the configuration
Description:
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2235
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass