hyundai-kia-connect-api 3.3.10__py2.py3-none-any.whl → 3.3.12__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.
@@ -82,6 +82,7 @@ def _check_response_for_errors(response: dict) -> None:
82
82
  - F: failure
83
83
  resCode / resMsg known values:
84
84
  - 0000: no error
85
+ - 4002: "Invalid request body - invalid deviceId", relogin will resolve but a bandaid.
85
86
  - 4004: "Duplicate request"
86
87
  - 4081: "Request timeout"
87
88
  - 5031: "Unavailable remote control - Service Temporary Unavailable"
@@ -92,6 +93,7 @@ def _check_response_for_errors(response: dict) -> None:
92
93
  """
93
94
 
94
95
  error_code_mapping = {
96
+ "4002": DeviceIDError,
95
97
  "4004": DuplicateRequestError,
96
98
  "4081": RequestTimeoutError,
97
99
  "5031": ServiceTemporaryUnavailable,
@@ -108,7 +110,9 @@ def _check_response_for_errors(response: dict) -> None:
108
110
  if response["resCode"] in error_code_mapping:
109
111
  raise error_code_mapping[response["resCode"]](response["resMsg"])
110
112
  else:
111
- raise APIError(f"Server returned: '{response['resMsg']}'")
113
+ raise APIError(
114
+ f"Server returned: '{response['rescode']}' '{response['resMsg']}'"
115
+ )
112
116
 
113
117
 
114
118
  class KiaUvoApiEU(ApiImpl):
@@ -122,8 +126,9 @@ class KiaUvoApiEU(ApiImpl):
122
126
  _LOGGER.warning(f"Unsupported language: {language}, fallback to en")
123
127
  language = "en" # fallback to English
124
128
  self.LANGUAGE: str = language
129
+ self.brand: int = brand
125
130
 
126
- if BRANDS[brand] == BRAND_KIA:
131
+ if BRANDS[self.brand] == BRAND_KIA:
127
132
  self.BASE_DOMAIN: str = "prd.eu-ccapi.kia.com"
128
133
  self.CCSP_SERVICE_ID: str = "fdc85c00-0a2f-4c64-bcb4-2cfb1500730a"
129
134
  self.APP_ID: str = "a2b8469b-30a3-4361-8e13-6fceea8fbe74"
@@ -131,12 +136,14 @@ class KiaUvoApiEU(ApiImpl):
131
136
  "Basic ZmRjODVjMDAtMGEyZi00YzY0LWJjYjQtMmNmYjE1MDA3MzBhOnNlY3JldA=="
132
137
  )
133
138
  self.LOGIN_FORM_HOST = "eu-account.kia.com"
134
- elif BRANDS[brand] == BRAND_HYUNDAI:
139
+ self.PUSH_TYPE = "APNS"
140
+ elif BRANDS[self.brand] == BRAND_HYUNDAI:
135
141
  self.BASE_DOMAIN: str = "prd.eu-ccapi.hyundai.com"
136
142
  self.CCSP_SERVICE_ID: str = "6d477c38-3ca4-4cf3-9557-2a1929a94654"
137
143
  self.APP_ID: str = "014d2225-8495-4735-812d-2616334fd15d"
138
144
  self.BASIC_AUTHORIZATION: str = "Basic NmQ0NzdjMzgtM2NhNC00Y2YzLTk1NTctMmExOTI5YTk0NjU0OktVeTQ5WHhQekxwTHVvSzB4aEJDNzdXNlZYaG10UVI5aVFobUlGampvWTRJcHhzVg==" # noqa
139
145
  self.LOGIN_FORM_HOST = "eu-account.hyundai.com"
146
+ self.PUSH_TYPE = "GCM"
140
147
 
141
148
  self.BASE_URL: str = self.BASE_DOMAIN + ":8080"
142
149
  self.USER_API_URL: str = "https://" + self.BASE_URL + "/api/v1/user/"
@@ -146,7 +153,7 @@ class KiaUvoApiEU(ApiImpl):
146
153
  self.CLIENT_ID: str = self.CCSP_SERVICE_ID
147
154
  self.GCM_SENDER_ID = 199360397125
148
155
 
149
- if BRANDS[brand] == BRAND_KIA:
156
+ if BRANDS[self.brand] == BRAND_KIA:
150
157
  auth_client_id = "572e0304-5f8d-4b4c-9dd5-41aa84eed160"
151
158
  self.LOGIN_FORM_URL: str = (
152
159
  "https://"
@@ -159,7 +166,7 @@ class KiaUvoApiEU(ApiImpl):
159
166
  + self.LANGUAGE
160
167
  + "&state=$service_id:$user_id"
161
168
  )
162
- elif BRANDS[brand] == BRAND_HYUNDAI:
169
+ elif BRANDS[self.brand] == BRAND_HYUNDAI:
163
170
  auth_client_id = "64621b96-0f0d-11ec-82a8-0242ac130003"
164
171
  self.LOGIN_FORM_URL: str = (
165
172
  "https://"
@@ -175,7 +182,7 @@ class KiaUvoApiEU(ApiImpl):
175
182
 
176
183
  self.stamps_url: str = (
177
184
  "https://raw.githubusercontent.com/neoPix/bluelinky-stamps/master/"
178
- + BRANDS[brand].lower()
185
+ + BRANDS[self.brand].lower()
179
186
  + "-"
180
187
  + self.APP_ID
181
188
  + ".v2.json"
@@ -1086,7 +1093,7 @@ class KiaUvoApiEU(ApiImpl):
1086
1093
  url = self.SPA_API_URL + "notifications/register"
1087
1094
  payload = {
1088
1095
  "pushRegId": registration_id,
1089
- "pushType": "APNS",
1096
+ "pushType": self.PUSH_TYPE,
1090
1097
  "uuid": str(uuid.uuid4()),
1091
1098
  }
1092
1099
 
@@ -18,6 +18,14 @@ class AuthenticationError(HyundaiKiaException):
18
18
  pass
19
19
 
20
20
 
21
+ class DeviceIDError(AuthenticationError):
22
+ """
23
+ Raised upon receipt of an Invalid Device ID error.
24
+ """
25
+
26
+ pass
27
+
28
+
21
29
  class APIError(HyundaiKiaException):
22
30
  """
23
31
  Generic API error
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hyundai-kia-connect-api
3
- Version: 3.3.10
3
+ Version: 3.3.12
4
4
  Summary: Python Boilerplate contains all the boilerplate you need to create a Python package.
5
5
  Home-page: https://github.com/fuatakgun/hyundai_kia_connect_api
6
6
  Author: Fuat Akgun
@@ -3,17 +3,17 @@ hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py,sha256=QStSWimMzxcBGmM0NyVk0egw
3
3
  hyundai_kia_connect_api/KiaUvoAPIUSA.py,sha256=NWQNOH3lQzxjyifeMIAjPfWamVzArqymZ8VgKP3_VMY,27449
4
4
  hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=8OSXWRw0Nt8l5Ac63iZwBYiYK-x89j_k-tqEip4NaUw,29985
5
5
  hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=QmjevKCMt4GzhtF7ZZ5tfyV0rAqNTE9EHmhQr4u1Pgw,51311
6
- hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=lzE90f4J84gUkmkfrHjv_XKCEZ2LkhzNxBjrrU1Zi5o,53964
6
+ hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=lDa7b1SCk0maY23BWq69TJZLqbYuUroXwe4jcWC_KL4,54278
7
7
  hyundai_kia_connect_api/Token.py,sha256=odHSR-D7CnL19hh6f6cc3rablchzqS0I2GXf7jWvsQE,369
8
8
  hyundai_kia_connect_api/Vehicle.py,sha256=AKEjl8ct9LPGPwWOiSclUQPXZK822MzojbaQbfIzBak,12772
9
9
  hyundai_kia_connect_api/VehicleManager.py,sha256=eCMXePM3yhzVx1FBFLYhQ1pQHGmP07l3pqRMw18VPUA,9083
10
10
  hyundai_kia_connect_api/__init__.py,sha256=nHv9mufHuKHAwEZncS4EQRxYMohsR9NdLltOSts83lo,423
11
11
  hyundai_kia_connect_api/const.py,sha256=Yb7yJtALZzsmnizzzqiKpdZbh1FTu4jc9tFj-tuB4rc,1690
12
- hyundai_kia_connect_api/exceptions.py,sha256=pUKegYbLkRXmgfAW4ApW805xwyhcjOA6SEo1VVmwiDU,1228
12
+ hyundai_kia_connect_api/exceptions.py,sha256=ucDTprH8l3n9REeYDzpPsDpt_Y-i1WHkulw_7C3dJ6A,1353
13
13
  hyundai_kia_connect_api/utils.py,sha256=u0F4PdWA0l_ikZaWJU_9WAwtW1t__KPOiHDef8Ka7ck,751
14
- hyundai_kia_connect_api-3.3.10.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
15
- hyundai_kia_connect_api-3.3.10.dist-info/LICENSE,sha256=AsZwIRViAze7ObwO6V6IB0q4caXv6DJS2-3dsU1FWy8,1069
16
- hyundai_kia_connect_api-3.3.10.dist-info/METADATA,sha256=ARjIu8zRrafFLEqMtUt_ownbiYtT1YsW1RIGksh6p4E,5715
17
- hyundai_kia_connect_api-3.3.10.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
18
- hyundai_kia_connect_api-3.3.10.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
19
- hyundai_kia_connect_api-3.3.10.dist-info/RECORD,,
14
+ hyundai_kia_connect_api-3.3.12.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
15
+ hyundai_kia_connect_api-3.3.12.dist-info/LICENSE,sha256=AsZwIRViAze7ObwO6V6IB0q4caXv6DJS2-3dsU1FWy8,1069
16
+ hyundai_kia_connect_api-3.3.12.dist-info/METADATA,sha256=uc8IkZ9wB3_Umi2_JPxNgU4dC93G76JyMeCpjA3iZ_c,5715
17
+ hyundai_kia_connect_api-3.3.12.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
18
+ hyundai_kia_connect_api-3.3.12.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
19
+ hyundai_kia_connect_api-3.3.12.dist-info/RECORD,,