Improve the flow with fallback if there is a network issue (#1670)

This commit is contained in:
Pascal Vizeli 2020-04-22 11:06:59 +02:00 committed by GitHub
parent ffa91e150d
commit ebfaaeaa6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -34,9 +34,6 @@ class Core(CoreSysAttributes):
"""Setup supervisor orchestration.""" """Setup supervisor orchestration."""
self.state = CoreStates.STARTUP self.state = CoreStates.STARTUP
# load last available data
await self.sys_updater.load()
# Load DBus # Load DBus
await self.sys_dbus.load() await self.sys_dbus.load()
@ -46,6 +43,9 @@ class Core(CoreSysAttributes):
# Load Plugins container # Load Plugins container
await self.sys_plugins.load() await self.sys_plugins.load()
# load last available data
await self.sys_updater.load()
# Load Home Assistant # Load Home Assistant
await self.sys_homeassistant.load() await self.sys_homeassistant.load()

View File

@ -252,15 +252,13 @@ class HomeAssistant(JsonConfig, CoreSysAttributes):
_LOGGER.info("Setup HomeAssistant landingpage") _LOGGER.info("Setup HomeAssistant landingpage")
while True: while True:
try: try:
await self.instance.install( await self.instance.install("landingpage", image=self.image)
"landingpage", image=self.sys_updater.image_homeassistant
)
except DockerAPIError: except DockerAPIError:
_LOGGER.warning("Fails install landingpage, retry after 30sec") _LOGGER.warning("Fails install landingpage, retry after 30sec")
await asyncio.sleep(30) await asyncio.sleep(30)
else: else:
self.version = self.instance.version self.version = self.instance.version
self.image = self.sys_updater.image_homeassistant self.image = self.instance.image
self.save_data() self.save_data()
break break