From 3b1ad5c0cdb92dbc16218936145d2871fdc27075 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 16 Jun 2021 11:45:06 +0200 Subject: [PATCH] Run API watchdog only if core is running (#2961) * Run API watchdog only if core is running * negate * fix comment --- supervisor/misc/tasks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/supervisor/misc/tasks.py b/supervisor/misc/tasks.py index 950060cc4..f405b2c8b 100644 --- a/supervisor/misc/tasks.py +++ b/supervisor/misc/tasks.py @@ -204,9 +204,9 @@ class Tasks(CoreSysAttributes): Try 2 times to call API before we restart Home-Assistant. Maybe we had a delay in our system. """ - # If Home-Assistant is active + # Home-Assistant is active/running if ( - await self.sys_homeassistant.core.is_failed() + not await self.sys_homeassistant.core.is_running() or not self.sys_homeassistant.watchdog or self.sys_homeassistant.error_state ): @@ -215,7 +215,7 @@ class Tasks(CoreSysAttributes): # Init cache data retry_scan = self._cache.get(HASS_WATCHDOG_API, 0) - # If Home-Assistant API is up + # Home-Assistant API is up if ( self.sys_homeassistant.core.in_progress or await self.sys_homeassistant.api.check_api_state()