From 758d6c9caedae70c3bd39ae92f497da687a23695 Mon Sep 17 00:00:00 2001 From: cdnninja Date: Mon, 12 Feb 2024 19:36:10 -0700 Subject: [PATCH] fix(AU): Time logic for certain python versions (#505) Solves an issue that can cause faults. --- hyundai_kia_connect_api/KiaUvoApiAU.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hyundai_kia_connect_api/KiaUvoApiAU.py b/hyundai_kia_connect_api/KiaUvoApiAU.py index 6a0f51dd..8a787c54 100644 --- a/hyundai_kia_connect_api/KiaUvoApiAU.py +++ b/hyundai_kia_connect_api/KiaUvoApiAU.py @@ -231,11 +231,10 @@ def _get_time_from_string(self, value, timesection) -> dt.datetime.time: if int(value) > 1260: value = dt.datetime.strptime(str(value), "%H%M").time() else: - if timesection == 0: - value = str(value) + " AM" - elif timesection == 1: - value = str(value) + " PM" - value = dt.datetime.strptime(value, "%I%M %p").time() + d = dt.datetime.strptime(str(value), "%I%M") + if timesection > 0: + d += dt.timedelta(hours=12) + value = d.time() return value def update_vehicle_with_cached_state(self, token: Token, vehicle: Vehicle) -> None: