diff --git a/hassio/core.py b/hassio/core.py index cd3d08f41..db676d91b 100644 --- a/hassio/core.py +++ b/hassio/core.py @@ -116,8 +116,7 @@ class HassIO(CoreSysAttributes): await self.sys_addons.boot(STARTUP_APPLICATION) # store new last boot - self.sys_config.last_boot = self.sys_hardware.last_boot - self.sys_config.save_data() + self._update_last_boot() finally: # Add core tasks into scheduler @@ -134,6 +133,9 @@ class HassIO(CoreSysAttributes): # don't process scheduler anymore self.sys_scheduler.suspend = True + # store new last boot / prevent time adjustments + self._update_last_boot() + # process async stop tasks try: with async_timeout.timeout(10): @@ -162,3 +164,8 @@ class HassIO(CoreSysAttributes): await self.sys_addons.shutdown(STARTUP_SERVICES) await self.sys_addons.shutdown(STARTUP_SYSTEM) await self.sys_addons.shutdown(STARTUP_INITIALIZE) + + def _update_last_boot(self): + """Update last boot time.""" + self.sys_config.last_boot = self.sys_hardware.last_boot + self.sys_config.save_data()