From ebfaaeaa6bf69e599e7119c0c9b751b9cbb86129 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 22 Apr 2020 11:06:59 +0200 Subject: [PATCH] Improve the flow with fallback if there is a network issue (#1670) --- supervisor/core.py | 6 +++--- supervisor/homeassistant.py | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/supervisor/core.py b/supervisor/core.py index f891b7d5a..f5c390312 100644 --- a/supervisor/core.py +++ b/supervisor/core.py @@ -34,9 +34,6 @@ class Core(CoreSysAttributes): """Setup supervisor orchestration.""" self.state = CoreStates.STARTUP - # load last available data - await self.sys_updater.load() - # Load DBus await self.sys_dbus.load() @@ -46,6 +43,9 @@ class Core(CoreSysAttributes): # Load Plugins container await self.sys_plugins.load() + # load last available data + await self.sys_updater.load() + # Load Home Assistant await self.sys_homeassistant.load() diff --git a/supervisor/homeassistant.py b/supervisor/homeassistant.py index decc49bf3..ace29c2a6 100644 --- a/supervisor/homeassistant.py +++ b/supervisor/homeassistant.py @@ -252,15 +252,13 @@ class HomeAssistant(JsonConfig, CoreSysAttributes): _LOGGER.info("Setup HomeAssistant landingpage") while True: try: - await self.instance.install( - "landingpage", image=self.sys_updater.image_homeassistant - ) + await self.instance.install("landingpage", image=self.image) except DockerAPIError: _LOGGER.warning("Fails install landingpage, retry after 30sec") await asyncio.sleep(30) else: self.version = self.instance.version - self.image = self.sys_updater.image_homeassistant + self.image = self.instance.image self.save_data() break