Skip to content

Commit

Permalink
fix(AU): Time logic for certain python versions (#505)
Browse files Browse the repository at this point in the history
Solves an issue that can cause faults.
  • Loading branch information
cdnninja committed Feb 13, 2024
1 parent 26f5e41 commit 758d6c9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions hyundai_kia_connect_api/KiaUvoApiAU.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 758d6c9

Please sign in to comment.