mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-17 22:26:30 +00:00
parent
05554ccf7e
commit
6a7617faad
@ -8,6 +8,7 @@ import shutil
|
|||||||
import tarfile
|
import tarfile
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
|
|
||||||
|
from deepmerge import Merger
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from voluptuous.humanize import humanize_error
|
from voluptuous.humanize import humanize_error
|
||||||
|
|
||||||
@ -30,6 +31,8 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
RE_VOLUME = re.compile(MAP_VOLUME)
|
RE_VOLUME = re.compile(MAP_VOLUME)
|
||||||
RE_WEBUI = re.compile(r"^(.*\[HOST\]:)\[PORT:(\d+)\](.*)$")
|
RE_WEBUI = re.compile(r"^(.*\[HOST\]:)\[PORT:(\d+)\](.*)$")
|
||||||
|
|
||||||
|
MERGE_OPT = Merger([(dict, ['merge'])], ['override'], ['override'])
|
||||||
|
|
||||||
|
|
||||||
class Addon(object):
|
class Addon(object):
|
||||||
"""Hold data for addon inside HassIO."""
|
"""Hold data for addon inside HassIO."""
|
||||||
@ -104,10 +107,10 @@ class Addon(object):
|
|||||||
def options(self):
|
def options(self):
|
||||||
"""Return options with local changes."""
|
"""Return options with local changes."""
|
||||||
if self.is_installed:
|
if self.is_installed:
|
||||||
return {
|
return MERGE_OPT.merge(
|
||||||
**self.data.system[self._id][ATTR_OPTIONS],
|
self.data.system[self._id][ATTR_OPTIONS],
|
||||||
**self.data.user[self._id][ATTR_OPTIONS],
|
self.data.user[self._id][ATTR_OPTIONS],
|
||||||
}
|
)
|
||||||
return self.data.cache[self._id][ATTR_OPTIONS]
|
return self.data.cache[self._id][ATTR_OPTIONS]
|
||||||
|
|
||||||
@options.setter
|
@options.setter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user