Use default time zone for boot time (#161605)

This commit is contained in:
Craig Andrews
2026-01-27 10:49:35 -05:00
committed by GitHub
parent 0e08a6a69c
commit 187aa52d92
2 changed files with 5 additions and 3 deletions

View File

@@ -221,7 +221,9 @@ class SystemMonitorCoordinator(TimestampDataUpdateCoordinator[SensorData]):
if self._initial_update:
# Boot time only needs to refresh on first pass
self.boot_time = dt_util.utc_from_timestamp(self._psutil.boot_time())
self.boot_time = dt_util.utc_from_timestamp(
self._psutil.boot_time(), tz=dt_util.get_default_time_zone()
)
_LOGGER.debug("boot time: %s", self.boot_time)
selected_processes: list[Process] = []

View File

@@ -9,7 +9,7 @@
'vethxyzxyz': "[snicaddr(family=<AddressFamily.AF_INET: 2>, address='172.16.10.1', netmask='255.255.255.0', broadcast='255.255.255.255', ptp=None)]",
}),
'battery': 'sbattery(percent=93, secsleft=16628, power_plugged=False)',
'boot_time': '2024-02-24 15:00:00+00:00',
'boot_time': '2024-02-24 07:00:00-08:00',
'cpu_percent': '10.0',
'disk_usage': dict({
'/': 'sdiskusage(total=536870912000, used=322122547200, free=214748364800, percent=60.0)',
@@ -79,7 +79,7 @@
'data': dict({
'addresses': None,
'battery': 'sbattery(percent=93, secsleft=16628, power_plugged=False)',
'boot_time': '2024-02-24 15:00:00+00:00',
'boot_time': '2024-02-24 07:00:00-08:00',
'cpu_percent': '10.0',
'disk_usage': dict({
'/': 'sdiskusage(total=536870912000, used=322122547200, free=214748364800, percent=60.0)',