hyundai-kia-connect-api 3.17.9__tar.gz → 3.17.10__tar.gz

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.
Files changed (46) hide show
  1. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/LICENSE +0 -1
  2. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/PKG-INFO +1 -1
  3. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/KiaUvoApiAU.py +13 -10
  4. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/KiaUvoApiCA.py +2 -2
  5. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/KiaUvoApiCN.py +15 -13
  6. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/KiaUvoApiEU.py +15 -13
  7. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/Vehicle.py +1 -0
  8. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/const.py +7 -1
  9. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api.egg-info/PKG-INFO +1 -1
  10. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/setup.py +1 -1
  11. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/tests/eu_check_response_for_errors_test.py +5 -1
  12. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/AUTHORS.rst +0 -0
  13. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/CONTRIBUTING.rst +0 -0
  14. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/HISTORY.rst +0 -0
  15. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/MANIFEST.in +0 -0
  16. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/README.rst +0 -0
  17. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/docs/Makefile +0 -0
  18. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/docs/authors.rst +0 -0
  19. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/docs/conf.py +0 -0
  20. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/docs/contributing.rst +0 -0
  21. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/docs/history.rst +0 -0
  22. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/docs/index.rst +0 -0
  23. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/docs/installation.rst +0 -0
  24. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/docs/make.bat +0 -0
  25. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/docs/readme.rst +0 -0
  26. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/docs/usage.rst +0 -0
  27. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/ApiImpl.py +0 -0
  28. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/ApiImplType1.py +0 -0
  29. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py +0 -0
  30. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/KiaUvoAPIUSA.py +0 -0
  31. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/Token.py +0 -0
  32. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/VehicleManager.py +0 -0
  33. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/__init__.py +0 -0
  34. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/exceptions.py +0 -0
  35. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api/utils.py +0 -0
  36. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api.egg-info/SOURCES.txt +0 -0
  37. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api.egg-info/dependency_links.txt +0 -0
  38. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api.egg-info/not-zip-safe +0 -0
  39. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api.egg-info/requires.txt +0 -0
  40. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/hyundai_kia_connect_api.egg-info/top_level.txt +0 -0
  41. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/requirements.txt +0 -0
  42. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/setup.cfg +0 -0
  43. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/tests/__init__.py +0 -0
  44. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/tests/au_login_test.py +0 -0
  45. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/tests/ca_login_test.py +0 -0
  46. {hyundai_kia_connect_api-3.17.9 → hyundai_kia_connect_api-3.17.10}/tests/eu_login_test.py +0 -0
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hyundai_kia_connect_api
3
- Version: 3.17.9
3
+ Version: 3.17.10
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
@@ -43,7 +43,16 @@ from .const import (
43
43
  ENGINE_TYPES,
44
44
  OrderStatus,
45
45
  )
46
- from .exceptions import *
46
+ from .exceptions import (
47
+ AuthenticationError,
48
+ DuplicateRequestError,
49
+ RequestTimeoutError,
50
+ ServiceTemporaryUnavailable,
51
+ NoDataFound,
52
+ InvalidAPIResponseError,
53
+ APIError,
54
+ RateLimitingError,
55
+ )
47
56
  from .utils import (
48
57
  get_child_value,
49
58
  get_index_into_hex_temp,
@@ -53,9 +62,7 @@ from .utils import (
53
62
  _LOGGER = logging.getLogger(__name__)
54
63
 
55
64
  USER_AGENT_OK_HTTP: str = "okhttp/3.12.0"
56
- USER_AGENT_MOZILLA: str = (
57
- "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
58
- )
65
+ 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
59
66
 
60
67
 
61
68
  def _check_response_for_errors(response: dict) -> None:
@@ -106,16 +113,12 @@ class KiaUvoApiAU(ApiImplType1):
106
113
  self.BASE_URL: str = "au-apigw.ccs.kia.com.au:8082"
107
114
  self.CCSP_SERVICE_ID: str = "8acb778a-b918-4a8d-8624-73a0beb64289"
108
115
  self.APP_ID: str = "4ad4dcde-be23-48a8-bc1c-91b94f5c06f8" # Android app ID
109
- self.BASIC_AUTHORIZATION: str = (
110
- "Basic OGFjYjc3OGEtYjkxOC00YThkLTg2MjQtNzNhMGJlYjY0Mjg5OjdTY01NbTZmRVlYZGlFUEN4YVBhUW1nZVlkbFVyZndvaDRBZlhHT3pZSVMyQ3U5VA=="
111
- )
116
+ self.BASIC_AUTHORIZATION: str = "Basic OGFjYjc3OGEtYjkxOC00YThkLTg2MjQtNzNhMGJlYjY0Mjg5OjdTY01NbTZmRVlYZGlFUEN4YVBhUW1nZVlkbFVyZndvaDRBZlhHT3pZSVMyQ3U5VA=="
112
117
  elif BRANDS[brand] == BRAND_HYUNDAI:
113
118
  self.BASE_URL: str = "au-apigw.ccs.hyundai.com.au:8080"
114
119
  self.CCSP_SERVICE_ID: str = "855c72df-dfd7-4230-ab03-67cbf902bb1c"
115
120
  self.APP_ID: str = "f9ccfdac-a48d-4c57-bd32-9116963c24ed" # Android app ID
116
- self.BASIC_AUTHORIZATION: str = (
117
- "Basic ODU1YzcyZGYtZGZkNy00MjMwLWFiMDMtNjdjYmY5MDJiYjFjOmU2ZmJ3SE0zMllOYmhRbDBwdmlhUHAzcmY0dDNTNms5MWVjZUEzTUpMZGJkVGhDTw=="
118
- )
121
+ self.BASIC_AUTHORIZATION: str = "Basic ODU1YzcyZGYtZGZkNy00MjMwLWFiMDMtNjdjYmY5MDJiYjFjOmU2ZmJ3SE0zMllOYmhRbDBwdmlhUHAzcmY0dDNTNms5MWVjZUEzTUpMZGJkVGhDTw=="
119
122
 
120
123
  self.USER_API_URL: str = "https://" + self.BASE_URL + "/api/v1/user/"
121
124
  self.SPA_API_URL: str = "https://" + self.BASE_URL + "/api/v1/spa/"
@@ -509,7 +509,7 @@ class KiaUvoApiCA(ApiImpl):
509
509
  if response["responseHeader"]["responseCode"] != 0:
510
510
  raise APIError("No Location Located")
511
511
  return response["result"]
512
- except:
512
+ except Exception:
513
513
  _LOGGER.warning(f"{DOMAIN} - Get vehicle location failed")
514
514
  return None
515
515
 
@@ -717,7 +717,7 @@ class KiaUvoApiCA(ApiImpl):
717
717
  vehicle.ev_charge_limits_dc = [
718
718
  x["level"] for x in state if x["plugType"] == 0
719
719
  ][-1]
720
- except:
720
+ except Exception:
721
721
  _LOGGER.debug(f"{DOMAIN} - SOC Levels couldn't be found. May not be an EV.")
722
722
 
723
723
  def _get_charge_limits(self, token: Token, vehicle: Vehicle) -> dict:
@@ -12,7 +12,6 @@ from urllib.parse import parse_qs, urlparse
12
12
 
13
13
  import pytz
14
14
  import requests
15
- from bs4 import BeautifulSoup
16
15
  from dateutil import tz
17
16
 
18
17
  from .ApiImpl import (
@@ -43,7 +42,16 @@ from .const import (
43
42
  TEMPERATURE_UNITS,
44
43
  VEHICLE_LOCK_ACTION,
45
44
  )
46
- from .exceptions import *
45
+ from .exceptions import (
46
+ AuthenticationError,
47
+ DuplicateRequestError,
48
+ RequestTimeoutError,
49
+ ServiceTemporaryUnavailable,
50
+ NoDataFound,
51
+ InvalidAPIResponseError,
52
+ APIError,
53
+ RateLimitingError,
54
+ )
47
55
  from .utils import (
48
56
  get_child_value,
49
57
  get_index_into_hex_temp,
@@ -53,12 +61,8 @@ from .utils import (
53
61
  _LOGGER = logging.getLogger(__name__)
54
62
 
55
63
  USER_AGENT_OK_HTTP: str = "okhttp/3.12.0"
56
- USER_AGENT_MOZILLA: str = (
57
- "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
58
- )
59
- ACCEPT_HEADER_ALL: str = (
60
- "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" # noqa
61
- )
64
+ 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
65
+ ACCEPT_HEADER_ALL: str = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" # noqa
62
66
 
63
67
 
64
68
  def _check_response_for_errors(response: dict) -> None:
@@ -108,9 +112,7 @@ class KiaUvoApiCN(ApiImplType1):
108
112
  self.BASE_DOMAIN: str = "prd.cn-ccapi.kia.com"
109
113
  self.CCSP_SERVICE_ID: str = "9d5df92a-06ae-435f-b459-8304f2efcc67"
110
114
  self.APP_ID: str = "eea8762c-adfc-4ee4-8d7a-6e2452ddf342"
111
- self.BASIC_AUTHORIZATION: str = (
112
- "Basic OWQ1ZGY5MmEtMDZhZS00MzVmLWI0NTktODMwNGYyZWZjYzY3OnRzWGRrVWcwOEF2MlpaelhPZ1d6Snl4VVQ2eWVTbk5OUWtYWFBSZEtXRUFOd2wxcA=="
113
- )
115
+ self.BASIC_AUTHORIZATION: str = "Basic OWQ1ZGY5MmEtMDZhZS00MzVmLWI0NTktODMwNGYyZWZjYzY3OnRzWGRrVWcwOEF2MlpaelhPZ1d6Snl4VVQ2eWVTbk5OUWtYWFBSZEtXRUFOd2wxcA=="
114
116
  elif BRANDS[brand] == BRAND_HYUNDAI:
115
117
  self.BASE_DOMAIN: str = "prd.cn-ccapi.hyundai.com"
116
118
  self.CCSP_SERVICE_ID: str = "72b3d019-5bc7-443d-a437-08f307cf06e2"
@@ -486,7 +488,7 @@ class KiaUvoApiCN(ApiImplType1):
486
488
  vehicle.ev_charge_limits_dc = [
487
489
  x["targetSOClevel"] for x in target_soc_list if x["plugType"] == 0
488
490
  ][-1]
489
- except:
491
+ except Exception:
490
492
  _LOGGER.debug(f"{DOMAIN} - SOC Levels couldn't be found. May not be an EV.")
491
493
  if (
492
494
  get_child_value(
@@ -675,7 +677,7 @@ class KiaUvoApiCN(ApiImplType1):
675
677
  _LOGGER.debug(f"{DOMAIN} - _get_location response: {response}")
676
678
  _check_response_for_errors(response)
677
679
  return response["resMsg"]
678
- except:
680
+ except Exception:
679
681
  _LOGGER.debug(f"{DOMAIN} - _get_location failed")
680
682
  return None
681
683
 
@@ -45,7 +45,17 @@ from .const import (
45
45
  TEMPERATURE_UNITS,
46
46
  VEHICLE_LOCK_ACTION,
47
47
  )
48
- from .exceptions import *
48
+ from .exceptions import (
49
+ AuthenticationError,
50
+ DuplicateRequestError,
51
+ RequestTimeoutError,
52
+ ServiceTemporaryUnavailable,
53
+ NoDataFound,
54
+ InvalidAPIResponseError,
55
+ APIError,
56
+ RateLimitingError,
57
+ DeviceIDError,
58
+ )
49
59
  from .utils import (
50
60
  get_child_value,
51
61
  get_index_into_hex_temp,
@@ -55,12 +65,8 @@ from .utils import (
55
65
  _LOGGER = logging.getLogger(__name__)
56
66
 
57
67
  USER_AGENT_OK_HTTP: str = "okhttp/3.12.0"
58
- USER_AGENT_MOZILLA: str = (
59
- "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
60
- )
61
- ACCEPT_HEADER_ALL: str = (
62
- "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" # noqa
63
- )
68
+ 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
69
+ ACCEPT_HEADER_ALL: str = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" # noqa
64
70
 
65
71
  SUPPORTED_LANGUAGES_LIST = [
66
72
  "en", # English
@@ -160,9 +166,7 @@ class KiaUvoApiEU(ApiImplType1):
160
166
  self.CFB: str = base64.b64decode(
161
167
  "RFtoRq/vDXJmRndoZaZQyfOot7OrIqGVFj96iY2WL3yyH5Z/pUvlUhqmCxD2t+D65SQ="
162
168
  )
163
- self.BASIC_AUTHORIZATION: str = (
164
- "Basic NmQ0NzdjMzgtM2NhNC00Y2YzLTk1NTctMmExOTI5YTk0NjU0OktVeTQ5WHhQekxwTHVvSzB4aEJDNzdXNlZYaG10UVI5aVFobUlGampvWTRJcHhzVg==" # noqa
165
- )
169
+ self.BASIC_AUTHORIZATION: str = "Basic NmQ0NzdjMzgtM2NhNC00Y2YzLTk1NTctMmExOTI5YTk0NjU0OktVeTQ5WHhQekxwTHVvSzB4aEJDNzdXNlZYaG10UVI5aVFobUlGampvWTRJcHhzVg==" # noqa
166
170
  self.LOGIN_FORM_HOST = "eu-account.hyundai.com"
167
171
  self.PUSH_TYPE = "GCM"
168
172
  elif BRANDS[self.brand] == BRAND_GENESIS:
@@ -173,9 +177,7 @@ class KiaUvoApiEU(ApiImplType1):
173
177
  self.CFB: str = base64.b64decode(
174
178
  "RFtoRq/vDXJmRndoZaZQyYo3/qFLtVReW8P7utRPcc0ZxOzOELm9mexvviBk/qqIp4A="
175
179
  )
176
- self.BASIC_AUTHORIZATION: str = (
177
- "Basic NmQ0NzdjMzgtM2NhNC00Y2YzLTk1NTctMmExOTI5YTk0NjU0OktVeTQ5WHhQekxwTHVvSzB4aEJDNzdXNlZYaG10UVI5aVFobUlGampvWTRJcHhzVg==" # noqa
178
- )
180
+ self.BASIC_AUTHORIZATION: str = "Basic NmQ0NzdjMzgtM2NhNC00Y2YzLTk1NTctMmExOTI5YTk0NjU0OktVeTQ5WHhQekxwTHVvSzB4aEJDNzdXNlZYaG10UVI5aVFobUlGampvWTRJcHhzVg==" # noqa
179
181
  self.LOGIN_FORM_HOST = "accounts-eu.genesis.com"
180
182
  self.PUSH_TYPE = "GCM"
181
183
 
@@ -1,5 +1,6 @@
1
1
  # pylint:disable=missing-class-docstring,missing-function-docstring,wildcard-import,unused-wildcard-import,invalid-name
2
2
  """Vehicle class"""
3
+
3
4
  import logging
4
5
  import datetime
5
6
  import typing
@@ -29,7 +29,13 @@ LOGIN_TOKEN_LIFETIME = datetime.timedelta(hours=23)
29
29
 
30
30
  LENGTH_KILOMETERS = "km"
31
31
  LENGTH_MILES = "mi"
32
- DISTANCE_UNITS = {None: None, 0: None, 1: LENGTH_KILOMETERS, 3: LENGTH_MILES}
32
+ DISTANCE_UNITS = {
33
+ None: None,
34
+ 0: None,
35
+ 1: LENGTH_KILOMETERS,
36
+ 2: LENGTH_MILES,
37
+ 3: LENGTH_MILES,
38
+ }
33
39
 
34
40
  TEMPERATURE_C = "°C"
35
41
  TEMPERATURE_F = "°F"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hyundai_kia_connect_api
3
- Version: 3.17.9
3
+ Version: 3.17.10
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
@@ -44,6 +44,6 @@ setup(
44
44
  test_suite="tests",
45
45
  tests_require=test_requirements,
46
46
  url="https://github.com/fuatakgun/hyundai_kia_connect_api",
47
- version="3.17.9",
47
+ version="3.17.10",
48
48
  zip_safe=False,
49
49
  )
@@ -1,7 +1,11 @@
1
1
  import pytest
2
2
 
3
3
  from hyundai_kia_connect_api.KiaUvoApiEU import _check_response_for_errors
4
- from hyundai_kia_connect_api.exceptions import *
4
+ from hyundai_kia_connect_api.exceptions import (
5
+ RateLimitingError,
6
+ InvalidAPIResponseError,
7
+ APIError,
8
+ )
5
9
 
6
10
 
7
11
  def test_invalid_api_response():