From 254d6aee3243d46484f766023b7c81cc05d3342c Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 19 Nov 2018 16:44:21 +0100 Subject: [PATCH] Small code cleanups (#822) * Small code cleanups * Update homeassistant.py --- hassio/homeassistant.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hassio/homeassistant.py b/hassio/homeassistant.py index a4b8e57fb..91c47ce4a 100644 --- a/hassio/homeassistant.py +++ b/hassio/homeassistant.py @@ -471,21 +471,18 @@ class HomeAssistant(JsonConfig, CoreSysAttributes): while True: await asyncio.sleep(10) - # 1 - # Check if Container is is_running + # 1: Check if Container is is_running if not await self.instance.is_running(): _LOGGER.error("Home Assistant has crashed!") break - # 2 - # Check if API response + # 2: Check if API response if await self.sys_run_in_executor(check_port): _LOGGER.info("Detect a running Home Assistant instance") self._error_state = False return - # 3 - # Running DB Migration + # 3: Running DB Migration if migration_file.exists(): if not migration_progress: migration_progress = True @@ -496,8 +493,7 @@ class HomeAssistant(JsonConfig, CoreSysAttributes): start_time = time.monotonic() _LOGGER.info("Home Assistant record migration done") - # 4 - # Timeout + # 4: Timeout if time.monotonic() - start_time > self.wait_boot: _LOGGER.warning( "Don't wait anymore of Home Assistant startup!")