Propagate timezone setting to host in OS 16.2 and newer (#6099)

* Propagate timezone setting to host in OS 16.2 and newer

With home-assistant/operating-system#4224, timezone setting in OS can be
peristently set in HAOS as well. Propagate the timezone configured in
Supervisor config (which can be changed through general system settings
in HA Core) through the DBus API for setting the timezone.

* Persist timezone also when it's been obtained from Whoami

* Suppress pylint fixme error
This commit is contained in:
Jan Čermák
2025-08-20 01:30:57 +02:00
committed by GitHub
parent 4109c15a36
commit b49ce96df8
7 changed files with 112 additions and 1 deletions

View File

@@ -142,6 +142,7 @@ class APISupervisor(CoreSysAttributes):
):
await self.sys_run_in_executor(validate_timezone, timezone)
await self.sys_config.set_timezone(timezone)
await self.sys_host.control.set_timezone(timezone)
if ATTR_CHANNEL in body:
self.sys_updater.channel = body[ATTR_CHANNEL]