mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-09 18:26:30 +00:00
Reset default config with None (#320)
* Update addons.py * Update addon.py * Update API.md
This commit is contained in:
parent
94b44ec7fe
commit
70a721a47d
2
API.md
2
API.md
@ -417,7 +417,7 @@ Get all available addons.
|
||||
}
|
||||
```
|
||||
|
||||
For reset custom network/audio settings, set it `null`.
|
||||
Reset custom network/audio/options, set it `null`.
|
||||
|
||||
- POST `/addons/{addon}/start`
|
||||
|
||||
|
@ -120,7 +120,10 @@ class Addon(CoreSysAttributes):
|
||||
@options.setter
|
||||
def options(self, value):
|
||||
"""Store user addon options."""
|
||||
self._data.user[self._id][ATTR_OPTIONS] = deepcopy(value)
|
||||
if value is None:
|
||||
self._data.user[self._id][ATTR_OPTIONS] = {}
|
||||
else:
|
||||
self._data.user[self._id][ATTR_OPTIONS] = deepcopy(value)
|
||||
self._data.save()
|
||||
|
||||
@property
|
||||
|
@ -140,7 +140,7 @@ class APIAddons(CoreSysAttributes):
|
||||
addon = self._extract_addon(request)
|
||||
|
||||
addon_schema = SCHEMA_OPTIONS.extend({
|
||||
vol.Optional(ATTR_OPTIONS): addon.schema,
|
||||
vol.Optional(ATTR_OPTIONS): vol.Any(None, addon.schema),
|
||||
})
|
||||
|
||||
body = await api_validate(addon_schema, request)
|
||||
|
Loading…
x
Reference in New Issue
Block a user