hyundai-kia-connect-api 3.30.3__py2.py3-none-any.whl → 3.32.1__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,6 +34,7 @@ class ClimateRequestOptions:
34
34
  front_right_seat: int = None
35
35
  rear_left_seat: int = None
36
36
  rear_right_seat: int = None
37
+ steering_wheel: int = None
37
38
 
38
39
 
39
40
  @dataclass
@@ -905,17 +905,23 @@ class KiaUvoApiEU(ApiImplType1):
905
905
  def lock_action(
906
906
  self, token: Token, vehicle: Vehicle, action: VEHICLE_LOCK_ACTION
907
907
  ) -> str:
908
- url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/door"
908
+ if not vehicle.ccu_ccs2_protocol_support:
909
+ url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/door"
909
910
 
910
- payload = {"action": action.value, "deviceId": token.device_id}
911
- _LOGGER.debug(f"{DOMAIN} - Lock Action Request: {payload}")
912
- response = requests.post(
913
- url,
914
- json=payload,
915
- headers=self._get_authenticated_headers(
911
+ payload = {"action": action.value, "deviceId": token.device_id}
912
+ headers = self._get_authenticated_headers(
916
913
  token, vehicle.ccu_ccs2_protocol_support
917
- ),
918
- ).json()
914
+ )
915
+
916
+ else:
917
+ url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/door"
918
+
919
+ payload = {"command": action.value}
920
+ headers = self._get_control_headers(token, vehicle)
921
+
922
+ _LOGGER.debug(f"{DOMAIN} - Lock Action Request: {payload}")
923
+
924
+ response = requests.post(url, json=payload, headers=headers).json()
919
925
  _LOGGER.debug(f"{DOMAIN} - Lock Action Response: {response}")
920
926
  _check_response_for_errors(response)
921
927
  token.device_id = self._get_device_id(self._get_stamp())
@@ -1008,34 +1014,48 @@ class KiaUvoApiEU(ApiImplType1):
1008
1014
  return response["msgId"]
1009
1015
 
1010
1016
  def start_charge(self, token: Token, vehicle: Vehicle) -> str:
1011
- url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/charge"
1017
+ if not vehicle.ccu_ccs2_protocol_support:
1018
+ url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/charge"
1012
1019
 
1013
- payload = {"action": "start", "deviceId": token.device_id}
1014
- _LOGGER.debug(f"{DOMAIN} - Start Charge Action Request: {payload}")
1015
- response = requests.post(
1016
- url,
1017
- json=payload,
1018
- headers=self._get_authenticated_headers(
1020
+ payload = {"action": "start", "deviceId": token.device_id}
1021
+ headers = self._get_authenticated_headers(
1019
1022
  token, vehicle.ccu_ccs2_protocol_support
1020
- ),
1021
- ).json()
1023
+ )
1024
+
1025
+ else:
1026
+ url = (
1027
+ self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/charge"
1028
+ )
1029
+
1030
+ payload = {"command": "start"}
1031
+ headers = self._get_control_headers(token, vehicle)
1032
+
1033
+ _LOGGER.debug(f"{DOMAIN} - Start Charge Action Request: {payload}")
1034
+ response = requests.post(url, json=payload, headers=headers).json()
1022
1035
  _LOGGER.debug(f"{DOMAIN} - Start Charge Action Response: {response}")
1023
1036
  _check_response_for_errors(response)
1024
1037
  token.device_id = self._get_device_id(self._get_stamp())
1025
1038
  return response["msgId"]
1026
1039
 
1027
1040
  def stop_charge(self, token: Token, vehicle: Vehicle) -> str:
1028
- url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/charge"
1041
+ if not vehicle.ccu_ccs2_protocol_support:
1042
+ url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/charge"
1029
1043
 
1030
- payload = {"action": "stop", "deviceId": token.device_id}
1031
- _LOGGER.debug(f"{DOMAIN} - Stop Charge Action Request {payload}")
1032
- response = requests.post(
1033
- url,
1034
- json=payload,
1035
- headers=self._get_authenticated_headers(
1044
+ payload = {"action": "stop", "deviceId": token.device_id}
1045
+ headers = self._get_authenticated_headers(
1036
1046
  token, vehicle.ccu_ccs2_protocol_support
1037
- ),
1038
- ).json()
1047
+ )
1048
+
1049
+ else:
1050
+ url = (
1051
+ self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/charge"
1052
+ )
1053
+
1054
+ payload = {"command": "stop"}
1055
+ headers = self._get_control_headers(token, vehicle)
1056
+
1057
+ _LOGGER.debug(f"{DOMAIN} - Stop Charge Action Request: {payload}")
1058
+ response = requests.post(url, json=payload, headers=headers).json()
1039
1059
  _LOGGER.debug(f"{DOMAIN} - Stop Charge Action Response: {response}")
1040
1060
  _check_response_for_errors(response)
1041
1061
  token.device_id = self._get_device_id(self._get_stamp())
@@ -1764,4 +1784,5 @@ class KiaUvoApiEU(ApiImplType1):
1764
1784
 
1765
1785
  # if iterate the whole notifications list and
1766
1786
  # can't find the action, raise an exception
1767
- raise APIError(f"No action found with ID {action_id}")
1787
+ # Old code: raise APIError(f"No action found with ID {action_id}")
1788
+ return OrderStatus.UNKNOWN
@@ -691,6 +691,8 @@ class KiaUvoApiUSA(ApiImpl):
691
691
  options.defrost = False
692
692
  if options.duration is None:
693
693
  options.duration = 5
694
+ if options.steering_wheel is None:
695
+ options.steering_wheel = 0
694
696
 
695
697
  body = {
696
698
  "remoteClimate": {
@@ -703,8 +705,8 @@ class KiaUvoApiUSA(ApiImpl):
703
705
  "heatingAccessory": {
704
706
  "rearWindow": 1 if options.heating in [1, 2, 4] else 0,
705
707
  "sideMirror": 1 if options.heating in [1, 4] else 0,
706
- "steeringWheel": 1 if options.heating in [1, 3, 4] else 0,
707
- "steeringWheelStep": 2 if options.heating in [1, 3, 4] else 0,
708
+ "steeringWheel": 1 if options.steering_wheel in [1, 2] else 0,
709
+ "steeringWheelStep": options.steering_wheel,
708
710
  },
709
711
  "ignitionOnDuration": {
710
712
  "unit": 4,
@@ -92,6 +92,8 @@ class OrderStatus(Enum):
92
92
  # no response received from vehicle.
93
93
  # no way to know if the order was executed, but most likely not
94
94
  TIMEOUT = "TIMEOUT"
95
+ # Used when we don't know the status of the order
96
+ UNKNOWN = "UNKNOWN"
95
97
 
96
98
 
97
99
  class WINDOW_STATE(IntEnum):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: hyundai_kia_connect_api
3
- Version: 3.30.3
3
+ Version: 3.32.1
4
4
  Summary: Python Boilerplate contains all the boilerplate you need to create a Python package.
5
5
  Home-page: https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api
6
6
  Author: Fuat Akgun
@@ -1,23 +1,23 @@
1
- hyundai_kia_connect_api/ApiImpl.py,sha256=9DoAtk8-pE0WaLzRTM7uydkUoxS_Almcooeonp7vTQE,7538
1
+ hyundai_kia_connect_api/ApiImpl.py,sha256=eCEQEz6L-7EN2eKnrYiHrYC0pPV-ngGFcayF0tFdPxA,7569
2
2
  hyundai_kia_connect_api/ApiImplType1.py,sha256=PnKwpbCoYGOXBWzBLIlDSrC6daIYeW9qlfW7TM4HCU0,12184
3
3
  hyundai_kia_connect_api/HyundaiBlueLinkApiUSA.py,sha256=Tx-L4ZWiPhq-uHcjWSUzjLEsfunV6nzyzqQpjPTYuIo,36831
4
4
  hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=tslh0gzvPBwYJmcWlf9B0l7PyYZdy2e7GqpRkl8_Svk,48471
5
5
  hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=QXs7Gk3uvv1719B8E-Gqe1H0hBh_jQflBJtPZZxvz2g,31460
6
6
  hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=cwIPZ0dU6HolKdooUQeQKlLAic6YU8dQmNs0VQDBgpQ,47035
7
- hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=wNHMuyANzunMzp6DtjJmA1k4DbkXcHvebA-bS107ueA,70416
8
- hyundai_kia_connect_api/KiaUvoApiUSA.py,sha256=gwGUcyJB82fM-tnUqistw4upvzMFnWew9JMY_V88bkQ,30480
7
+ hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=TxgO2dfLjKSKfSkRMoTL_fbmzRFRPb8oJ9IDztD50Ug,71300
8
+ hyundai_kia_connect_api/KiaUvoApiUSA.py,sha256=G2sGtv88sBZuAz8qKYq_3_JNXIkxEjOBAzwM6R8GUi0,30548
9
9
  hyundai_kia_connect_api/Token.py,sha256=ZsPvXh1ID7FUTGHAqhZUZyrKT7xVbOtIn6FRJn4Ygf0,370
10
10
  hyundai_kia_connect_api/Vehicle.py,sha256=raCMzJsLuJnVHlFJ16VKdKat55L0uivbbcZRDCGWTxI,18793
11
11
  hyundai_kia_connect_api/VehicleManager.py,sha256=I0HDOsbXDen-26vyD7YR-RUgdaofOZrv_H_PPPuWjHg,11087
12
12
  hyundai_kia_connect_api/__init__.py,sha256=IkyVeIMbcFJZgLaiiNnUVA1Ferxvrm1bXHKVg01cxvc,319
13
13
  hyundai_kia_connect_api/bluelink.py,sha256=sBU7hlElie21GU4Ma-i4a5vdztGc2jtmlVBbbgUqmTE,19720
14
- hyundai_kia_connect_api/const.py,sha256=HE0_1_be4ERB73vsekWxv6TDWd8cvAgY1oPZojUrcwM,2096
14
+ hyundai_kia_connect_api/const.py,sha256=scBlhrMims0W6_pESVVdQz2uUxczg2cf2qDQ7avbhVo,2174
15
15
  hyundai_kia_connect_api/exceptions.py,sha256=m7gyDnvA5OVAK4EXSP_ZwE0s0uV8HsGUV0tiYwqofK0,1343
16
16
  hyundai_kia_connect_api/utils.py,sha256=J0aXUX-nKIoS3XbelatNh-DZlHRU2_DYz_Mg_ZUKQJU,1957
17
- hyundai_kia_connect_api-3.30.3.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
18
- hyundai_kia_connect_api-3.30.3.dist-info/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
19
- hyundai_kia_connect_api-3.30.3.dist-info/METADATA,sha256=HqHzH99JlSrf3T0ytokyo_wKRPFSaRfdhX0dpP7Rz6c,6872
20
- hyundai_kia_connect_api-3.30.3.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
21
- hyundai_kia_connect_api-3.30.3.dist-info/entry_points.txt,sha256=XfrroRdyC_9q9VXjEZe5SdRPhkQyCCE4S7ZK6XSKelA,67
22
- hyundai_kia_connect_api-3.30.3.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
23
- hyundai_kia_connect_api-3.30.3.dist-info/RECORD,,
17
+ hyundai_kia_connect_api-3.32.1.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
18
+ hyundai_kia_connect_api-3.32.1.dist-info/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
19
+ hyundai_kia_connect_api-3.32.1.dist-info/METADATA,sha256=8zScOgvPy8LK5oEwqNDjEk6xclX4l2BjzFSR9PImsw0,6872
20
+ hyundai_kia_connect_api-3.32.1.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
21
+ hyundai_kia_connect_api-3.32.1.dist-info/entry_points.txt,sha256=XfrroRdyC_9q9VXjEZe5SdRPhkQyCCE4S7ZK6XSKelA,67
22
+ hyundai_kia_connect_api-3.32.1.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
23
+ hyundai_kia_connect_api-3.32.1.dist-info/RECORD,,