1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-25 04:46:25 +00:00

Fix time adjustments on latest boot (#1187)

* Fix time adjustments on latest boot

* Fix spell
This commit is contained in:
Pascal Vizeli
2019-08-06 09:24:22 +02:00
committed by GitHub
parent b7c07a2555
commit 882586b246

View File

@@ -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()