Skip to content

Commit

Permalink
feat: Add AC and DC charge limits for Hyundai USA Bluelink (#585)
Browse files Browse the repository at this point in the history
The Bluelink API returns AC and DC charge limit data for EVs, similar to
Kia's API. This change selects for it identically to KiaUvoAPIUSA.py,
but with the correct object path for Bluelink's API response.
  • Loading branch information
DevDotMathias committed Jul 7, 2024
1 parent fe55abc commit f0fbb0f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,19 @@ def _update_vehicle_properties(self, vehicle: Vehicle, state: dict) -> None:
vehicle.ev_battery_is_plugged_in = get_child_value(
state, "vehicleStatus.evStatus.batteryPlugin"
)
ChargeDict = get_child_value(
state, "vehicleStatus.evStatus.reservChargeInfos.targetSOClist"
)
try:
vehicle.ev_charge_limits_ac = [
x["targetSOClevel"] for x in ChargeDict if x["plugType"] == 1
][-1]
vehicle.ev_charge_limits_dc = [
x["targetSOClevel"] for x in ChargeDict if x["plugType"] == 0
][-1]
except Exception:
_LOGGER.debug(f"{DOMAIN} - SOC Levels couldn't be found. May not be an EV.")

vehicle.ev_driving_range = (
get_child_value(
state,
Expand Down

0 comments on commit f0fbb0f

Please sign in to comment.