Skip to content

Commit

Permalink
fix: handle force updates not having odometer (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdnninja committed Aug 23, 2024
1 parent 2885f35 commit 78a0ca9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions hyundai_kia_connect_api/KiaUvoApiEU.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,16 +402,16 @@ def _update_vehicle_properties(self, vehicle: Vehicle, state: dict) -> None:
)
else:
vehicle.last_updated_at = dt.datetime.now(self.data_timezone)

vehicle.odometer = (
get_child_value(state, "odometer.value"),
DISTANCE_UNITS[
get_child_value(
state,
"odometer.unit",
)
],
)
if get_child_value(state, "odometer.value"):
vehicle.odometer = (
get_child_value(state, "odometer.value"),
DISTANCE_UNITS[
get_child_value(
state,
"odometer.unit",
)
],
)
vehicle.car_battery_percentage = get_child_value(
state, "vehicleStatus.battery.batSoc"
)
Expand Down

0 comments on commit 78a0ca9

Please sign in to comment.