WIP: Split add-on store logic (#1067)

* Split add-on store logic

* finish data model

* Cleanup models

* Cleanup imports

* split up store addons

* More cleanup

* Go to stable

* Fix layout

* Cleanup interface

* Fix restore/snapshot

* Fix algo

* Fix reload task

* Fix typing / remove indirect add-on references

* Fix version

* Fix repository data

* Fix addon repo

* Fix api check

* Fix API return

* Fix model

* Temp fix available

* Fix lint

* Fix install

* Fix partial restore

* Fix store restore

* Fix ingress port

* Fix API

* Fix style
This commit is contained in:
Pascal Vizeli
2019-05-07 17:27:00 +02:00
committed by GitHub
parent 4e94043bca
commit 9ce9e10dfd
27 changed files with 1290 additions and 1039 deletions

View File

@@ -31,6 +31,7 @@ from .interface import DockerInterface
if TYPE_CHECKING:
from ..addons.addon import Addon
_LOGGER = logging.getLogger(__name__)
AUDIO_DEVICE = "/dev/snd:/dev/snd:rwm"
@@ -39,15 +40,10 @@ AUDIO_DEVICE = "/dev/snd:/dev/snd:rwm"
class DockerAddon(DockerInterface):
"""Docker Hass.io wrapper for Home Assistant."""
def __init__(self, coresys: CoreSys, slug: str):
def __init__(self, coresys: CoreSys, addon: Addon):
"""Initialize Docker Home Assistant wrapper."""
super().__init__(coresys)
self._id: str = slug
@property
def addon(self) -> Addon:
"""Return add-on of Docker image."""
return self.sys_addons.get(self._id)
self.addon = addon
@property
def image(self) -> str:
@@ -76,7 +72,7 @@ class DockerAddon(DockerInterface):
def version(self) -> str:
"""Return version of Docker image."""
if self.addon.legacy:
return self.addon.version_installed
return self.addon.version
return super().version
@property
@@ -363,7 +359,7 @@ class DockerAddon(DockerInterface):
Need run inside executor.
"""
build_env = AddonBuild(self.coresys, self._id)
build_env = AddonBuild(self.coresys, self.addon)
_LOGGER.info("Start build %s:%s", self.image, tag)
try: