hyundai-kia-connect-api 3.33.0__py2.py3-none-any.whl → 3.33.2__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.
- hyundai_kia_connect_api/ApiImplType1.py +133 -0
- hyundai_kia_connect_api/KiaUvoApiAU.py +7 -82
- hyundai_kia_connect_api/KiaUvoApiEU.py +1 -124
- {hyundai_kia_connect_api-3.33.0.dist-info → hyundai_kia_connect_api-3.33.2.dist-info}/METADATA +1 -1
- {hyundai_kia_connect_api-3.33.0.dist-info → hyundai_kia_connect_api-3.33.2.dist-info}/RECORD +10 -10
- {hyundai_kia_connect_api-3.33.0.dist-info → hyundai_kia_connect_api-3.33.2.dist-info}/WHEEL +0 -0
- {hyundai_kia_connect_api-3.33.0.dist-info → hyundai_kia_connect_api-3.33.2.dist-info}/entry_points.txt +0 -0
- {hyundai_kia_connect_api-3.33.0.dist-info → hyundai_kia_connect_api-3.33.2.dist-info}/licenses/AUTHORS.rst +0 -0
- {hyundai_kia_connect_api-3.33.0.dist-info → hyundai_kia_connect_api-3.33.2.dist-info}/licenses/LICENSE +0 -0
- {hyundai_kia_connect_api-3.33.0.dist-info → hyundai_kia_connect_api-3.33.2.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,8 @@
|
|
1
1
|
"""ApiImplType1.py"""
|
2
2
|
|
3
3
|
import datetime as dt
|
4
|
+
import requests
|
5
|
+
import logging
|
4
6
|
from typing import Optional
|
5
7
|
|
6
8
|
from .ApiImpl import (
|
@@ -15,14 +17,70 @@ from .utils import (
|
|
15
17
|
)
|
16
18
|
|
17
19
|
from .const import (
|
20
|
+
DOMAIN,
|
18
21
|
DISTANCE_UNITS,
|
19
22
|
ENGINE_TYPES,
|
20
23
|
SEAT_STATUS,
|
21
24
|
TEMPERATURE_UNITS,
|
22
25
|
)
|
23
26
|
|
27
|
+
from .exceptions import (
|
28
|
+
APIError,
|
29
|
+
DuplicateRequestError,
|
30
|
+
RequestTimeoutError,
|
31
|
+
ServiceTemporaryUnavailable,
|
32
|
+
NoDataFound,
|
33
|
+
InvalidAPIResponseError,
|
34
|
+
RateLimitingError,
|
35
|
+
DeviceIDError,
|
36
|
+
)
|
37
|
+
|
24
38
|
USER_AGENT_OK_HTTP: str = "okhttp/3.12.0"
|
25
39
|
|
40
|
+
_LOGGER = logging.getLogger(__name__)
|
41
|
+
|
42
|
+
|
43
|
+
def _check_response_for_errors(response: dict) -> None:
|
44
|
+
"""
|
45
|
+
Checks for errors in the API response.
|
46
|
+
If an error is found, an exception is raised.
|
47
|
+
retCode known values:
|
48
|
+
- S: success
|
49
|
+
- F: failure
|
50
|
+
resCode / resMsg known values:
|
51
|
+
- 0000: no error
|
52
|
+
- 4002: "Invalid request body - invalid deviceId",
|
53
|
+
relogin will resolve but a bandaid.
|
54
|
+
- 4004: "Duplicate request"
|
55
|
+
- 4081: "Request timeout"
|
56
|
+
- 5031: "Unavailable remote control - Service Temporary Unavailable"
|
57
|
+
- 5091: "Exceeds number of requests"
|
58
|
+
- 5921: "No Data Found v2 - No Data Found v2"
|
59
|
+
- 9999: "Undefined Error - Response timeout"
|
60
|
+
:param response: the API's JSON response
|
61
|
+
"""
|
62
|
+
|
63
|
+
error_code_mapping = {
|
64
|
+
"4002": DeviceIDError,
|
65
|
+
"4004": DuplicateRequestError,
|
66
|
+
"4081": RequestTimeoutError,
|
67
|
+
"5031": ServiceTemporaryUnavailable,
|
68
|
+
"5091": RateLimitingError,
|
69
|
+
"5921": NoDataFound,
|
70
|
+
"9999": RequestTimeoutError,
|
71
|
+
}
|
72
|
+
|
73
|
+
if not any(x in response for x in ["retCode", "resCode", "resMsg"]):
|
74
|
+
_LOGGER.error(f"Unknown API response format: {response}")
|
75
|
+
raise InvalidAPIResponseError()
|
76
|
+
|
77
|
+
if response["retCode"] == "F":
|
78
|
+
if response["resCode"] in error_code_mapping:
|
79
|
+
raise error_code_mapping[response["resCode"]](response["resMsg"])
|
80
|
+
raise APIError(
|
81
|
+
f"Server returned: '{response['resCode']}' '{response['resMsg']}'"
|
82
|
+
)
|
83
|
+
|
26
84
|
|
27
85
|
class ApiImplType1(ApiImpl):
|
28
86
|
"""ApiImplType1"""
|
@@ -46,6 +104,16 @@ class ApiImplType1(ApiImpl):
|
|
46
104
|
"User-Agent": USER_AGENT_OK_HTTP,
|
47
105
|
}
|
48
106
|
|
107
|
+
def _get_control_headers(self, token: Token, vehicle: Vehicle) -> dict:
|
108
|
+
control_token, _ = self._get_control_token(token)
|
109
|
+
authenticated_headers = self._get_authenticated_headers(
|
110
|
+
token, vehicle.ccu_ccs2_protocol_support
|
111
|
+
)
|
112
|
+
return authenticated_headers | {
|
113
|
+
"Authorization": control_token,
|
114
|
+
"AuthorizationCCSP": control_token,
|
115
|
+
}
|
116
|
+
|
49
117
|
def _update_vehicle_properties_ccs2(self, vehicle: Vehicle, state: dict) -> None:
|
50
118
|
if get_child_value(state, "Date"):
|
51
119
|
vehicle.last_updated_at = parse_datetime(
|
@@ -319,3 +387,68 @@ class ApiImplType1(ApiImpl):
|
|
319
387
|
)
|
320
388
|
|
321
389
|
vehicle.data = state
|
390
|
+
|
391
|
+
def start_charge(self, token: Token, vehicle: Vehicle) -> str:
|
392
|
+
if not vehicle.ccu_ccs2_protocol_support:
|
393
|
+
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/charge"
|
394
|
+
|
395
|
+
payload = {"action": "start", "deviceId": token.device_id}
|
396
|
+
headers = self._get_authenticated_headers(
|
397
|
+
token, vehicle.ccu_ccs2_protocol_support
|
398
|
+
)
|
399
|
+
|
400
|
+
else:
|
401
|
+
url = (
|
402
|
+
self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/charge"
|
403
|
+
)
|
404
|
+
|
405
|
+
payload = {"command": "start"}
|
406
|
+
headers = self._get_control_headers(token, vehicle)
|
407
|
+
|
408
|
+
_LOGGER.debug(f"{DOMAIN} - Start Charge Action Request: {payload}")
|
409
|
+
response = requests.post(url, json=payload, headers=headers).json()
|
410
|
+
_LOGGER.debug(f"{DOMAIN} - Start Charge Action Response: {response}")
|
411
|
+
_check_response_for_errors(response)
|
412
|
+
token.device_id = self._get_device_id(self._get_stamp())
|
413
|
+
return response["msgId"]
|
414
|
+
|
415
|
+
def stop_charge(self, token: Token, vehicle: Vehicle) -> str:
|
416
|
+
if not vehicle.ccu_ccs2_protocol_support:
|
417
|
+
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/charge"
|
418
|
+
|
419
|
+
payload = {"action": "stop", "deviceId": token.device_id}
|
420
|
+
headers = self._get_authenticated_headers(
|
421
|
+
token, vehicle.ccu_ccs2_protocol_support
|
422
|
+
)
|
423
|
+
|
424
|
+
else:
|
425
|
+
url = (
|
426
|
+
self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/charge"
|
427
|
+
)
|
428
|
+
|
429
|
+
payload = {"command": "stop"}
|
430
|
+
headers = self._get_control_headers(token, vehicle)
|
431
|
+
|
432
|
+
_LOGGER.debug(f"{DOMAIN} - Stop Charge Action Request: {payload}")
|
433
|
+
response = requests.post(url, json=payload, headers=headers).json()
|
434
|
+
_LOGGER.debug(f"{DOMAIN} - Stop Charge Action Response: {response}")
|
435
|
+
_check_response_for_errors(response)
|
436
|
+
token.device_id = self._get_device_id(self._get_stamp())
|
437
|
+
return response["msgId"]
|
438
|
+
|
439
|
+
def set_charging_current(self, token: Token, vehicle: Vehicle, level: int) -> str:
|
440
|
+
url = (
|
441
|
+
self.SPA_API_URL + "vehicles/" + vehicle.id + "/ccs2/charge/chargingcurrent"
|
442
|
+
)
|
443
|
+
|
444
|
+
body = {"chargingCurrent": level}
|
445
|
+
response = requests.post(
|
446
|
+
url,
|
447
|
+
json=body,
|
448
|
+
headers=self._get_authenticated_headers(
|
449
|
+
token, vehicle.ccu_ccs2_protocol_support
|
450
|
+
),
|
451
|
+
).json()
|
452
|
+
_LOGGER.debug(f"{DOMAIN} - Set Charging Current Response: {response}")
|
453
|
+
_check_response_for_errors(response)
|
454
|
+
return response["msgId"]
|
@@ -29,6 +29,7 @@ from .Vehicle import (
|
|
29
29
|
TripInfo,
|
30
30
|
DayTripCounts,
|
31
31
|
)
|
32
|
+
from .ApiImplType1 import _check_response_for_errors
|
32
33
|
from .const import (
|
33
34
|
BRAND_HYUNDAI,
|
34
35
|
BRAND_KIA,
|
@@ -44,13 +45,7 @@ from .const import (
|
|
44
45
|
)
|
45
46
|
from .exceptions import (
|
46
47
|
AuthenticationError,
|
47
|
-
DuplicateRequestError,
|
48
|
-
RequestTimeoutError,
|
49
|
-
ServiceTemporaryUnavailable,
|
50
|
-
NoDataFound,
|
51
|
-
InvalidAPIResponseError,
|
52
48
|
APIError,
|
53
|
-
RateLimitingError,
|
54
49
|
)
|
55
50
|
from .utils import (
|
56
51
|
get_child_value,
|
@@ -65,44 +60,6 @@ USER_AGENT_OK_HTTP: str = "okhttp/3.12.0"
|
|
65
60
|
USER_AGENT_MOZILLA: str = "Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19" # noqa
|
66
61
|
|
67
62
|
|
68
|
-
def _check_response_for_errors(response: dict) -> None:
|
69
|
-
"""
|
70
|
-
Checks for errors in the API response.
|
71
|
-
If an error is found, an exception is raised.
|
72
|
-
retCode known values:
|
73
|
-
- S: success
|
74
|
-
- F: failure
|
75
|
-
resCode / resMsg known values:
|
76
|
-
- 0000: no error
|
77
|
-
- 4004: "Duplicate request"
|
78
|
-
- 4081: "Request timeout"
|
79
|
-
- 5031: "Unavailable remote control - Service Temporary Unavailable"
|
80
|
-
- 5091: "Exceeds number of requests"
|
81
|
-
- 5921: "No Data Found v2 - No Data Found v2"
|
82
|
-
- 9999: "Undefined Error - Response timeout"
|
83
|
-
:param response: the API's JSON response
|
84
|
-
"""
|
85
|
-
|
86
|
-
error_code_mapping = {
|
87
|
-
"4004": DuplicateRequestError,
|
88
|
-
"4081": RequestTimeoutError,
|
89
|
-
"5031": ServiceTemporaryUnavailable,
|
90
|
-
"5091": RateLimitingError,
|
91
|
-
"5921": NoDataFound,
|
92
|
-
"9999": RequestTimeoutError,
|
93
|
-
}
|
94
|
-
|
95
|
-
if not any(x in response for x in ["retCode", "resCode", "resMsg"]):
|
96
|
-
_LOGGER.error(f"Unknown API response format: {response}")
|
97
|
-
raise InvalidAPIResponseError()
|
98
|
-
|
99
|
-
if response["retCode"] == "F":
|
100
|
-
if response["resCode"] in error_code_mapping:
|
101
|
-
raise error_code_mapping[response["resCode"]](response["resMsg"])
|
102
|
-
else:
|
103
|
-
raise APIError(f"Server returned: '{response['resMsg']}'")
|
104
|
-
|
105
|
-
|
106
63
|
class KiaUvoApiAU(ApiImplType1):
|
107
64
|
data_timezone = tz.gettz("Australia/Sydney")
|
108
65
|
temperature_range = [x * 0.5 for x in range(34, 54)]
|
@@ -125,14 +82,6 @@ class KiaUvoApiAU(ApiImplType1):
|
|
125
82
|
self.SPA_API_URL_V2: str = "https://" + self.BASE_URL + "/api/v2/spa/"
|
126
83
|
self.CLIENT_ID: str = self.CCSP_SERVICE_ID
|
127
84
|
|
128
|
-
def _get_control_headers(self, token: Token) -> dict:
|
129
|
-
control_token, _ = self._get_control_token(token)
|
130
|
-
authenticated_headers = self._get_authenticated_headers(token)
|
131
|
-
return authenticated_headers | {
|
132
|
-
"Authorization": control_token,
|
133
|
-
"AuthorizationCCSP": control_token,
|
134
|
-
}
|
135
|
-
|
136
85
|
def login(self, username: str, password: str) -> Token:
|
137
86
|
stamp = self._get_stamp()
|
138
87
|
device_id = self._get_device_id(stamp)
|
@@ -690,7 +639,7 @@ class KiaUvoApiAU(ApiImplType1):
|
|
690
639
|
payload = {"action": action.value, "deviceId": token.device_id}
|
691
640
|
_LOGGER.debug(f"{DOMAIN} - Lock Action Request: {payload}")
|
692
641
|
response = requests.post(
|
693
|
-
url, json=payload, headers=self._get_control_headers(token)
|
642
|
+
url, json=payload, headers=self._get_control_headers(token, vehicle)
|
694
643
|
).json()
|
695
644
|
_LOGGER.debug(f"{DOMAIN} - Lock Action Response: {response}")
|
696
645
|
_check_response_for_errors(response)
|
@@ -709,7 +658,7 @@ class KiaUvoApiAU(ApiImplType1):
|
|
709
658
|
}
|
710
659
|
_LOGGER.debug(f"{DOMAIN} - Window State Action Request: {payload}")
|
711
660
|
response = requests.post(
|
712
|
-
url, json=payload, headers=self._get_control_headers(token)
|
661
|
+
url, json=payload, headers=self._get_control_headers(token, vehicle)
|
713
662
|
).json()
|
714
663
|
_LOGGER.debug(f"{DOMAIN} - Window State Action Response: {response}")
|
715
664
|
_check_response_for_errors(response)
|
@@ -724,7 +673,7 @@ class KiaUvoApiAU(ApiImplType1):
|
|
724
673
|
payload = {"action": action.value, "deviceId": token.device_id}
|
725
674
|
_LOGGER.debug(f"{DOMAIN} - Charge Port Action Request: {payload}")
|
726
675
|
response = requests.post(
|
727
|
-
url, json=payload, headers=self._get_control_headers(token)
|
676
|
+
url, json=payload, headers=self._get_control_headers(token, vehicle)
|
728
677
|
).json()
|
729
678
|
_LOGGER.debug(f"{DOMAIN} - Charge Port Action Response: {response}")
|
730
679
|
_check_response_for_errors(response)
|
@@ -764,7 +713,7 @@ class KiaUvoApiAU(ApiImplType1):
|
|
764
713
|
}
|
765
714
|
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Request: {payload}")
|
766
715
|
response = requests.post(
|
767
|
-
url, json=payload, headers=self._get_control_headers(token)
|
716
|
+
url, json=payload, headers=self._get_control_headers(token, vehicle)
|
768
717
|
).json()
|
769
718
|
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Response: {response}")
|
770
719
|
_check_response_for_errors(response)
|
@@ -777,36 +726,12 @@ class KiaUvoApiAU(ApiImplType1):
|
|
777
726
|
}
|
778
727
|
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Request: {payload}")
|
779
728
|
response = requests.post(
|
780
|
-
url, json=payload, headers=self._get_control_headers(token)
|
729
|
+
url, json=payload, headers=self._get_control_headers(token, vehicle)
|
781
730
|
).json()
|
782
731
|
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Response: {response}")
|
783
732
|
_check_response_for_errors(response)
|
784
733
|
return response["msgId"]
|
785
734
|
|
786
|
-
def start_charge(self, token: Token, vehicle: Vehicle) -> str:
|
787
|
-
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/charge"
|
788
|
-
|
789
|
-
payload = {"action": "start", "deviceId": token.device_id}
|
790
|
-
_LOGGER.debug(f"{DOMAIN} - Start Charge Action Request: {payload}")
|
791
|
-
response = requests.post(
|
792
|
-
url, json=payload, headers=self._get_control_headers(token)
|
793
|
-
).json()
|
794
|
-
_LOGGER.debug(f"{DOMAIN} - Start Charge Action Response: {response}")
|
795
|
-
_check_response_for_errors(response)
|
796
|
-
return response["msgId"]
|
797
|
-
|
798
|
-
def stop_charge(self, token: Token, vehicle: Vehicle) -> str:
|
799
|
-
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/charge"
|
800
|
-
|
801
|
-
payload = {"action": "stop", "deviceId": token.device_id}
|
802
|
-
_LOGGER.debug(f"{DOMAIN} - Stop Charge Action Request {payload}")
|
803
|
-
response = requests.post(
|
804
|
-
url, json=payload, headers=self._get_control_headers(token)
|
805
|
-
).json()
|
806
|
-
_LOGGER.debug(f"{DOMAIN} - Stop Charge Action Response: {response}")
|
807
|
-
_check_response_for_errors(response)
|
808
|
-
return response["msgId"]
|
809
|
-
|
810
735
|
def _get_charge_limits(self, token: Token, vehicle: Vehicle) -> dict:
|
811
736
|
# Not currently used as value is in the general get.
|
812
737
|
# Most likely this forces the car the update it.
|
@@ -1010,7 +935,7 @@ class KiaUvoApiAU(ApiImplType1):
|
|
1010
935
|
]
|
1011
936
|
}
|
1012
937
|
response = requests.post(
|
1013
|
-
url, json=body, headers=self._get_control_headers(token)
|
938
|
+
url, json=body, headers=self._get_control_headers(token, vehicle)
|
1014
939
|
).json()
|
1015
940
|
_LOGGER.debug(f"{DOMAIN} - Set Charge Limits Response: {response}")
|
1016
941
|
_check_response_for_errors(response)
|
@@ -21,6 +21,7 @@ from .ApiImpl import (
|
|
21
21
|
ScheduleChargingClimateRequestOptions,
|
22
22
|
)
|
23
23
|
from .ApiImplType1 import ApiImplType1
|
24
|
+
from .ApiImplType1 import _check_response_for_errors
|
24
25
|
|
25
26
|
from .Token import Token
|
26
27
|
from .Vehicle import (
|
@@ -49,14 +50,7 @@ from .const import (
|
|
49
50
|
)
|
50
51
|
from .exceptions import (
|
51
52
|
AuthenticationError,
|
52
|
-
DuplicateRequestError,
|
53
|
-
RequestTimeoutError,
|
54
|
-
ServiceTemporaryUnavailable,
|
55
|
-
NoDataFound,
|
56
|
-
InvalidAPIResponseError,
|
57
53
|
APIError,
|
58
|
-
RateLimitingError,
|
59
|
-
DeviceIDError,
|
60
54
|
)
|
61
55
|
from .utils import (
|
62
56
|
get_child_value,
|
@@ -90,48 +84,6 @@ SUPPORTED_LANGUAGES_LIST = [
|
|
90
84
|
]
|
91
85
|
|
92
86
|
|
93
|
-
def _check_response_for_errors(response: dict) -> None:
|
94
|
-
"""
|
95
|
-
Checks for errors in the API response.
|
96
|
-
If an error is found, an exception is raised.
|
97
|
-
retCode known values:
|
98
|
-
- S: success
|
99
|
-
- F: failure
|
100
|
-
resCode / resMsg known values:
|
101
|
-
- 0000: no error
|
102
|
-
- 4002: "Invalid request body - invalid deviceId",
|
103
|
-
relogin will resolve but a bandaid.
|
104
|
-
- 4004: "Duplicate request"
|
105
|
-
- 4081: "Request timeout"
|
106
|
-
- 5031: "Unavailable remote control - Service Temporary Unavailable"
|
107
|
-
- 5091: "Exceeds number of requests"
|
108
|
-
- 5921: "No Data Found v2 - No Data Found v2"
|
109
|
-
- 9999: "Undefined Error - Response timeout"
|
110
|
-
:param response: the API's JSON response
|
111
|
-
"""
|
112
|
-
|
113
|
-
error_code_mapping = {
|
114
|
-
"4002": DeviceIDError,
|
115
|
-
"4004": DuplicateRequestError,
|
116
|
-
"4081": RequestTimeoutError,
|
117
|
-
"5031": ServiceTemporaryUnavailable,
|
118
|
-
"5091": RateLimitingError,
|
119
|
-
"5921": NoDataFound,
|
120
|
-
"9999": RequestTimeoutError,
|
121
|
-
}
|
122
|
-
|
123
|
-
if not any(x in response for x in ["retCode", "resCode", "resMsg"]):
|
124
|
-
_LOGGER.error(f"Unknown API response format: {response}")
|
125
|
-
raise InvalidAPIResponseError()
|
126
|
-
|
127
|
-
if response["retCode"] == "F":
|
128
|
-
if response["resCode"] in error_code_mapping:
|
129
|
-
raise error_code_mapping[response["resCode"]](response["resMsg"])
|
130
|
-
raise APIError(
|
131
|
-
f"Server returned: '{response['resCode']}' '{response['resMsg']}'"
|
132
|
-
)
|
133
|
-
|
134
|
-
|
135
87
|
class KiaUvoApiEU(ApiImplType1):
|
136
88
|
data_timezone = tz.gettz("Europe/Berlin")
|
137
89
|
temperature_range = [x * 0.5 for x in range(28, 60)]
|
@@ -231,16 +183,6 @@ class KiaUvoApiEU(ApiImplType1):
|
|
231
183
|
+ "&state=$service_id:$user_id"
|
232
184
|
)
|
233
185
|
|
234
|
-
def _get_control_headers(self, token: Token, vehicle: Vehicle) -> dict:
|
235
|
-
control_token, _ = self._get_control_token(token)
|
236
|
-
authenticated_headers = self._get_authenticated_headers(
|
237
|
-
token, vehicle.ccu_ccs2_protocol_support
|
238
|
-
)
|
239
|
-
return authenticated_headers | {
|
240
|
-
"Authorization": control_token,
|
241
|
-
"AuthorizationCCSP": control_token,
|
242
|
-
}
|
243
|
-
|
244
186
|
def login(self, username: str, password: str) -> Token:
|
245
187
|
stamp = self._get_stamp()
|
246
188
|
device_id = self._get_device_id(stamp)
|
@@ -1013,54 +955,6 @@ class KiaUvoApiEU(ApiImplType1):
|
|
1013
955
|
token.device_id = self._get_device_id(self._get_stamp())
|
1014
956
|
return response["msgId"]
|
1015
957
|
|
1016
|
-
def start_charge(self, token: Token, vehicle: Vehicle) -> str:
|
1017
|
-
if not vehicle.ccu_ccs2_protocol_support:
|
1018
|
-
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/charge"
|
1019
|
-
|
1020
|
-
payload = {"action": "start", "deviceId": token.device_id}
|
1021
|
-
headers = self._get_authenticated_headers(
|
1022
|
-
token, vehicle.ccu_ccs2_protocol_support
|
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()
|
1035
|
-
_LOGGER.debug(f"{DOMAIN} - Start Charge Action Response: {response}")
|
1036
|
-
_check_response_for_errors(response)
|
1037
|
-
token.device_id = self._get_device_id(self._get_stamp())
|
1038
|
-
return response["msgId"]
|
1039
|
-
|
1040
|
-
def stop_charge(self, token: Token, vehicle: Vehicle) -> str:
|
1041
|
-
if not vehicle.ccu_ccs2_protocol_support:
|
1042
|
-
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/charge"
|
1043
|
-
|
1044
|
-
payload = {"action": "stop", "deviceId": token.device_id}
|
1045
|
-
headers = self._get_authenticated_headers(
|
1046
|
-
token, vehicle.ccu_ccs2_protocol_support
|
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()
|
1059
|
-
_LOGGER.debug(f"{DOMAIN} - Stop Charge Action Response: {response}")
|
1060
|
-
_check_response_for_errors(response)
|
1061
|
-
token.device_id = self._get_device_id(self._get_stamp())
|
1062
|
-
return response["msgId"]
|
1063
|
-
|
1064
958
|
def start_hazard_lights(self, token: Token, vehicle: Vehicle) -> str:
|
1065
959
|
url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/light"
|
1066
960
|
|
@@ -1330,23 +1224,6 @@ class KiaUvoApiEU(ApiImplType1):
|
|
1330
1224
|
_check_response_for_errors(response)
|
1331
1225
|
return response["msgId"]
|
1332
1226
|
|
1333
|
-
def set_charging_current(self, token: Token, vehicle: Vehicle, level: int) -> str:
|
1334
|
-
url = (
|
1335
|
-
self.SPA_API_URL + "vehicles/" + vehicle.id + "/ccs2/charge/chargingcurrent"
|
1336
|
-
)
|
1337
|
-
|
1338
|
-
body = {"chargingCurrent": level}
|
1339
|
-
response = requests.post(
|
1340
|
-
url,
|
1341
|
-
json=body,
|
1342
|
-
headers=self._get_authenticated_headers(
|
1343
|
-
token, vehicle.ccu_ccs2_protocol_support
|
1344
|
-
),
|
1345
|
-
).json()
|
1346
|
-
_LOGGER.debug(f"{DOMAIN} - Set Charging Current Response: {response}")
|
1347
|
-
_check_response_for_errors(response)
|
1348
|
-
return response["msgId"]
|
1349
|
-
|
1350
1227
|
def schedule_charging_and_climate(
|
1351
1228
|
self,
|
1352
1229
|
token: Token,
|
{hyundai_kia_connect_api-3.33.0.dist-info → hyundai_kia_connect_api-3.33.2.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hyundai_kia_connect_api
|
3
|
-
Version: 3.33.
|
3
|
+
Version: 3.33.2
|
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
|
{hyundai_kia_connect_api-3.33.0.dist-info → hyundai_kia_connect_api-3.33.2.dist-info}/RECORD
RENAMED
@@ -1,10 +1,10 @@
|
|
1
1
|
hyundai_kia_connect_api/ApiImpl.py,sha256=PuK3dID01qTGB6aGtQY4uf1hF-t4d03wUzG_gUFn_1g,8353
|
2
|
-
hyundai_kia_connect_api/ApiImplType1.py,sha256=
|
2
|
+
hyundai_kia_connect_api/ApiImplType1.py,sha256=6uSqZYWmFT08gH1OL1h7SJso3HvqH9GszSQzngQbWcc,16993
|
3
3
|
hyundai_kia_connect_api/HyundaiBlueLinkApiUSA.py,sha256=FGYyrS3dSq8Plfu8DQMwVG1LM3nmRv8Y4vrN7wZ4oVY,36988
|
4
|
-
hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=
|
4
|
+
hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=Ox-GXfu2h6dsAA1tgXRVDCYgMP5Hi9IHMXDBzmYzBxQ,45668
|
5
5
|
hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=XBya0yHZ2MC3TBVQLSc6N-SzmGt_s3l4nGVyNgmjl9Q,32514
|
6
6
|
hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=cwIPZ0dU6HolKdooUQeQKlLAic6YU8dQmNs0VQDBgpQ,47035
|
7
|
-
hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=
|
7
|
+
hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=G3sfyyHaAnUeoYWC3rOpyrw_FfOs9ZDOEGUJuRTkuBc,66669
|
8
8
|
hyundai_kia_connect_api/KiaUvoApiUSA.py,sha256=8DP7iOORHtU98LipcAYEPdtJvubBlUP2-jlDxAhTDhQ,30548
|
9
9
|
hyundai_kia_connect_api/Token.py,sha256=ZsPvXh1ID7FUTGHAqhZUZyrKT7xVbOtIn6FRJn4Ygf0,370
|
10
10
|
hyundai_kia_connect_api/Vehicle.py,sha256=hZT0wU7-mMi85bgqNHMu6CyhQQ5h-Jfmoc1ce2uPhYM,18867
|
@@ -14,10 +14,10 @@ hyundai_kia_connect_api/bluelink.py,sha256=JiNIHl-Qi8zwqyN6ywKg5CdXOLT74WkvpjVcn
|
|
14
14
|
hyundai_kia_connect_api/const.py,sha256=dXEh-lpthH8000nUXFoRZpQXkTxVHDAgDe_KqnSZhZw,2280
|
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.33.
|
18
|
-
hyundai_kia_connect_api-3.33.
|
19
|
-
hyundai_kia_connect_api-3.33.
|
20
|
-
hyundai_kia_connect_api-3.33.
|
21
|
-
hyundai_kia_connect_api-3.33.
|
22
|
-
hyundai_kia_connect_api-3.33.
|
23
|
-
hyundai_kia_connect_api-3.33.
|
17
|
+
hyundai_kia_connect_api-3.33.2.dist-info/licenses/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
|
18
|
+
hyundai_kia_connect_api-3.33.2.dist-info/licenses/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
|
19
|
+
hyundai_kia_connect_api-3.33.2.dist-info/METADATA,sha256=b0UCE6-Lvmy1zPUY-VPz0SYj8VolaQ7r7UeohiyYDdA,7142
|
20
|
+
hyundai_kia_connect_api-3.33.2.dist-info/WHEEL,sha256=MAQBAzGbXNI3bUmkDsiV_duv8i-gcdnLzw7cfUFwqhU,109
|
21
|
+
hyundai_kia_connect_api-3.33.2.dist-info/entry_points.txt,sha256=XfrroRdyC_9q9VXjEZe5SdRPhkQyCCE4S7ZK6XSKelA,67
|
22
|
+
hyundai_kia_connect_api-3.33.2.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
|
23
|
+
hyundai_kia_connect_api-3.33.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hyundai_kia_connect_api-3.33.0.dist-info → hyundai_kia_connect_api-3.33.2.dist-info}/top_level.txt
RENAMED
File without changes
|