From 947c627553bd9f43de180b82f5177ee27187a95e Mon Sep 17 00:00:00 2001 From: bitnimble Date: Mon, 1 Apr 2024 00:32:12 +1100 Subject: [PATCH] fix: parse ccs2 last_updated_at as UTC instead of local timezone (#540) --- hyundai_kia_connect_api/ApiImplType1.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hyundai_kia_connect_api/ApiImplType1.py b/hyundai_kia_connect_api/ApiImplType1.py index cf9b85d1..d8a6a3db 100644 --- a/hyundai_kia_connect_api/ApiImplType1.py +++ b/hyundai_kia_connect_api/ApiImplType1.py @@ -44,8 +44,9 @@ def _get_authenticated_headers( def _update_vehicle_properties_ccs2(self, vehicle: Vehicle, state: dict) -> None: if get_child_value(state, "Date"): + # `Date` field is in UTC time vehicle.last_updated_at = parse_datetime( - get_child_value(state, "Date"), self.data_timezone + get_child_value(state, "Date"), dt.timezone.utc ) else: vehicle.last_updated_at = dt.datetime.now(self.data_timezone)