WIP: Make dns, post_up and post_down optional #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Like we discussed in #14. I have never worked with Home Assistant Addons before so I hope I got everything correct. My initial thought was to make
dns
,post_up
andpost_down
optional via the schema, changingstr
tostr?
in the schema but that just used the default value from options instead. I changed approach to just allow an empty value instead.DNS
Set the dns list to an empty list,
dns: []
, this will removeDNS = ...
fromwg0.conf
PostUP and PostDown
Set the post_up (or post_down) to an empty string,
post_up: ""
, this will removePostUp = ...
fromwg0.conf
Related Issues
What do you think? An alternative would to use
str?
and remove the default values fordns
,post_up
andpost_down
from options. That should not break existing installations, but will change the behavior a little. What do you prefer?