Implement network update API for enabled, ipv4 and ipv6#189
Implement network update API for enabled, ipv4 and ipv6#189frenck merged 2 commits intohassio-addons:mainfrom
Conversation
WalkthroughThe changes enhance network configuration capabilities by adding a setter mode to the existing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
|
not stale |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
|
not stale |
There was a problem hiding this comment.
Pull request overview
Adds support in Bashio’s network helpers to update interface configuration (enabled state plus IPv4/IPv6 settings) via the Home Assistant Supervisor network update endpoint.
Changes:
- Extend
bashio::network.enabledto optionally set the enabled state via/network/interface/<iface>/update. - Add
bashio::network.ipv4getter/setter that reads.ipv4and updates IPv4 settings using a JSON payload. - Add
bashio::network.ipv6getter/setter that reads.ipv6and updates IPv6 settings using a JSON payload.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Proposed Changes
Based on https://developers.home-assistant.io/docs/api/supervisor/endpoints/#network
Changing enabled option is trivial.
New IPv4 and IPv6 functions use JSON for input/output: I've experimented with it, and even the docs says that all the fields are optional, in reality we have to specify eg. address, nameservers and gateway together. So it makes sense to get them in a JSON struct (not only with the current individual get functions), and setting them with JSON is way more simple then coding one-by-one, and AFAIK this is the standard around this library.
Wifi had no individual getter methods, so I didn't created a JSON get/set function for Wifi.
Related Issues
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.