hyundai-kia-connect-api 3.17.9__py2.py3-none-any.whl → 3.17.10__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.
@@ -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"
@@ -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
@@ -0,0 +1,21 @@
1
+ hyundai_kia_connect_api/ApiImpl.py,sha256=8qy1OPFzPv2fvj513Eq7OwW8TWB3ZBffQwuuDA_kQB0,5155
2
+ hyundai_kia_connect_api/ApiImplType1.py,sha256=u6ulHCGw7bqkoOnqSUyDZHtXzf3QoXvlloMHGl9O-nM,754
3
+ hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py,sha256=FVWDzmkO_jsc_r4WzufgxaJkeVYhf9UAw9A6r37b-Dc,26750
4
+ hyundai_kia_connect_api/KiaUvoAPIUSA.py,sha256=kQo3PA_FktsAHhdugZi0lrpMcp96WNXcvBJPbIJIcfY,31217
5
+ hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=VlWIXPeA4GHpJfYRX2cgEGhhky8dqb1MuDD8MnGC97w,48403
6
+ hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=BqlN837TirQzlxDPTFKZrkTtAJEOtvim_ubQw9JL1vc,30378
7
+ hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=0XzOk24L_IukSgU7Iv33RsaTJsZekHetCxTPdich20Y,47553
8
+ hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=QaQORCY5dBG-s9Bn3Bz7Uvh5f7KBq6yKThqrMT7-Fl4,68816
9
+ hyundai_kia_connect_api/Token.py,sha256=ZsPvXh1ID7FUTGHAqhZUZyrKT7xVbOtIn6FRJn4Ygf0,370
10
+ hyundai_kia_connect_api/Vehicle.py,sha256=glJ87IiCWFyJM5WG7zXdewfuMyCjDGe-nsRZmjD01BA,13645
11
+ hyundai_kia_connect_api/VehicleManager.py,sha256=JdJ8tUCVGciVC1SJubmMQqEZ7KXp6DlI_UiOQPkDeN4,9654
12
+ hyundai_kia_connect_api/__init__.py,sha256=nqODLee6fwh8EwA6gzRrTN8hQP1SBFqfYRmvMIQtT0w,518
13
+ hyundai_kia_connect_api/const.py,sha256=ofi_ZfGxJYo0FWIcGFbIMSMRdKRtaK4GUDhFiQRvZeI,2007
14
+ hyundai_kia_connect_api/exceptions.py,sha256=m7gyDnvA5OVAK4EXSP_ZwE0s0uV8HsGUV0tiYwqofK0,1343
15
+ hyundai_kia_connect_api/utils.py,sha256=rfhERPXkzqelsaieLtiAyN9xDDTheNyKX5aBPRLrHf4,1117
16
+ hyundai_kia_connect_api-3.17.10.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
17
+ hyundai_kia_connect_api-3.17.10.dist-info/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
18
+ hyundai_kia_connect_api-3.17.10.dist-info/METADATA,sha256=jJoQgpt0MwCdlxgaLMl4QCOYrb2hPxfYggiD_y8vxSo,6011
19
+ hyundai_kia_connect_api-3.17.10.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
20
+ hyundai_kia_connect_api-3.17.10.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
21
+ hyundai_kia_connect_api-3.17.10.dist-info/RECORD,,
@@ -1,21 +0,0 @@
1
- hyundai_kia_connect_api/ApiImpl.py,sha256=8qy1OPFzPv2fvj513Eq7OwW8TWB3ZBffQwuuDA_kQB0,5155
2
- hyundai_kia_connect_api/ApiImplType1.py,sha256=u6ulHCGw7bqkoOnqSUyDZHtXzf3QoXvlloMHGl9O-nM,754
3
- hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py,sha256=FVWDzmkO_jsc_r4WzufgxaJkeVYhf9UAw9A6r37b-Dc,26750
4
- hyundai_kia_connect_api/KiaUvoAPIUSA.py,sha256=kQo3PA_FktsAHhdugZi0lrpMcp96WNXcvBJPbIJIcfY,31217
5
- hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=SjLjysqNJFGkeGW8eyds4n8Id0HnJsi_a8dRF_y0zdA,48280
6
- hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=7bcDLcJ3JLLoWldPy514eKhWUAo1Gb1mu_3SaXno4v8,30358
7
- hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=iyciS-6v8QqwDkPj6D7lUAyR5dDylVApaZx6JKl4iNo,47416
8
- hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=Q_w80aRyio5iWNP5mYoTha4DqVCdMbHrisJbLHKKY-g,68682
9
- hyundai_kia_connect_api/Token.py,sha256=ZsPvXh1ID7FUTGHAqhZUZyrKT7xVbOtIn6FRJn4Ygf0,370
10
- hyundai_kia_connect_api/Vehicle.py,sha256=jx8m3z9QRg9BvLLMT8wL0yD6jCnsA_w1nYE19Pm0bUo,13644
11
- hyundai_kia_connect_api/VehicleManager.py,sha256=JdJ8tUCVGciVC1SJubmMQqEZ7KXp6DlI_UiOQPkDeN4,9654
12
- hyundai_kia_connect_api/__init__.py,sha256=nqODLee6fwh8EwA6gzRrTN8hQP1SBFqfYRmvMIQtT0w,518
13
- hyundai_kia_connect_api/const.py,sha256=C25jgV79u7SZF5xDy96gol_CekIkyI4h3goTyDEmng0,1967
14
- hyundai_kia_connect_api/exceptions.py,sha256=m7gyDnvA5OVAK4EXSP_ZwE0s0uV8HsGUV0tiYwqofK0,1343
15
- hyundai_kia_connect_api/utils.py,sha256=rfhERPXkzqelsaieLtiAyN9xDDTheNyKX5aBPRLrHf4,1117
16
- hyundai_kia_connect_api-3.17.9.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
17
- hyundai_kia_connect_api-3.17.9.dist-info/LICENSE,sha256=AsZwIRViAze7ObwO6V6IB0q4caXv6DJS2-3dsU1FWy8,1069
18
- hyundai_kia_connect_api-3.17.9.dist-info/METADATA,sha256=MoSe3LquJSCDMQfsPo9r99lClgIrPbTCKXaxnVAZtV8,6010
19
- hyundai_kia_connect_api-3.17.9.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
20
- hyundai_kia_connect_api-3.17.9.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
21
- hyundai_kia_connect_api-3.17.9.dist-info/RECORD,,