mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-25 18:16:32 +00:00
Fix time adjustments on latest boot (#1187)
* Fix time adjustments on latest boot * Fix spell
This commit is contained in:
parent
b7c07a2555
commit
882586b246
@ -116,8 +116,7 @@ class HassIO(CoreSysAttributes):
|
|||||||
await self.sys_addons.boot(STARTUP_APPLICATION)
|
await self.sys_addons.boot(STARTUP_APPLICATION)
|
||||||
|
|
||||||
# store new last boot
|
# store new last boot
|
||||||
self.sys_config.last_boot = self.sys_hardware.last_boot
|
self._update_last_boot()
|
||||||
self.sys_config.save_data()
|
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
# Add core tasks into scheduler
|
# Add core tasks into scheduler
|
||||||
@ -134,6 +133,9 @@ class HassIO(CoreSysAttributes):
|
|||||||
# don't process scheduler anymore
|
# don't process scheduler anymore
|
||||||
self.sys_scheduler.suspend = True
|
self.sys_scheduler.suspend = True
|
||||||
|
|
||||||
|
# store new last boot / prevent time adjustments
|
||||||
|
self._update_last_boot()
|
||||||
|
|
||||||
# process async stop tasks
|
# process async stop tasks
|
||||||
try:
|
try:
|
||||||
with async_timeout.timeout(10):
|
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_SERVICES)
|
||||||
await self.sys_addons.shutdown(STARTUP_SYSTEM)
|
await self.sys_addons.shutdown(STARTUP_SYSTEM)
|
||||||
await self.sys_addons.shutdown(STARTUP_INITIALIZE)
|
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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user