From 08242d61bce9300a573ad1274bb03c2872d1dd1a Mon Sep 17 00:00:00 2001 From: jrnk Date: Thu, 27 Jun 2024 22:09:55 +0200 Subject: [PATCH] fix: set charge current (#581) Clarified in the doc that it's Europe only (same as other functions) and added the function to the VehicleManager (needed for setting the value) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- hyundai_kia_connect_api/ApiImpl.py | 5 ++++- hyundai_kia_connect_api/VehicleManager.py | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hyundai_kia_connect_api/ApiImpl.py b/hyundai_kia_connect_api/ApiImpl.py index 56524ac4..3be80c9d 100644 --- a/hyundai_kia_connect_api/ApiImpl.py +++ b/hyundai_kia_connect_api/ApiImpl.py @@ -147,7 +147,10 @@ def set_charge_limits( pass def set_charging_current(self, token: Token, vehicle: Vehicle, level: int) -> str: - """Sets charge current level (1=100%, 2=90%, 3=60%). Returns the tracking ID""" + """ + Europe feature only. + Sets charge current level (1=100%, 2=90%, 3=60%). Returns the tracking ID + """ pass def set_windows_state( diff --git a/hyundai_kia_connect_api/VehicleManager.py b/hyundai_kia_connect_api/VehicleManager.py index 8eef22e8..ac159d52 100644 --- a/hyundai_kia_connect_api/VehicleManager.py +++ b/hyundai_kia_connect_api/VehicleManager.py @@ -165,6 +165,11 @@ def set_charge_limits(self, vehicle_id: str, ac: int, dc: int) -> str: self.token, self.get_vehicle(vehicle_id), ac, dc ) + def set_charging_current(self, vehicle_id: str, level: int) -> str: + return self.api.set_charging_current( + self.token, self.get_vehicle(vehicle_id), level + ) + def set_windows_state(self, vehicle_id: str, options: WindowRequestOptions) -> str: return self.api.set_windows_state( self.token, self.get_vehicle(vehicle_id), options