Skip to content

Commit

Permalink
fix: parse ccs2 last_updated_at as UTC instead of local timezone (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitnimble committed Mar 31, 2024
1 parent 5f63262 commit 947c627
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hyundai_kia_connect_api/ApiImplType1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 947c627

Please sign in to comment.