hyundai-kia-connect-api 3.17.7__py2.py3-none-any.whl → 3.17.9__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,24 +82,25 @@ class ApiImpl:
82
82
  def update_geocoded_location(
83
83
  self, token: Token, vehicle: Vehicle, use_email: bool
84
84
  ) -> None:
85
- email_parameter = ""
86
- if use_email is True:
87
- email_parameter = "&email=" + token.username
88
-
89
- url = (
90
- "https://nominatim.openstreetmap.org/reverse?lat="
91
- + str(vehicle.location_latitude)
92
- + "&lon="
93
- + str(vehicle.location_longitude)
94
- + "&format=json&addressdetails=1&zoom=18"
95
- + email_parameter
96
- )
97
- response = requests.get(url)
98
- response = response.json()
99
- vehicle.geocode = (
100
- get_child_value(response, "display_name"),
101
- get_child_value(response, "address"),
102
- )
85
+ if vehicle.location_latitude and vehicle.location_longitude:
86
+ email_parameter = ""
87
+ if use_email is True:
88
+ email_parameter = "&email=" + token.username
89
+
90
+ url = (
91
+ "https://nominatim.openstreetmap.org/reverse?lat="
92
+ + str(vehicle.location_latitude)
93
+ + "&lon="
94
+ + str(vehicle.location_longitude)
95
+ + "&format=json&addressdetails=1&zoom=18"
96
+ + email_parameter
97
+ )
98
+ response = requests.get(url)
99
+ response = response.json()
100
+ vehicle.geocode = (
101
+ get_child_value(response, "display_name"),
102
+ get_child_value(response, "address"),
103
+ )
103
104
 
104
105
  def lock_action(self, token: Token, vehicle: Vehicle, action: str) -> str:
105
106
  """Lock or unlocks a vehicle. Returns the tracking ID"""
@@ -0,0 +1,25 @@
1
+ from .ApiImpl import (
2
+ ApiImpl,
3
+ )
4
+ from .Token import Token
5
+
6
+ USER_AGENT_OK_HTTP: str = "okhttp/3.12.0"
7
+
8
+
9
+ class ApiImplType1(ApiImpl):
10
+ def __init__(self) -> None:
11
+ """Initialize."""
12
+
13
+ def _get_authenticated_headers(self, token: Token) -> dict:
14
+ return {
15
+ "Authorization": token.access_token,
16
+ "ccsp-service-id": self.CCSP_SERVICE_ID,
17
+ "ccsp-application-id": self.APP_ID,
18
+ "Stamp": self._get_stamp(),
19
+ "ccsp-device-id": token.device_id,
20
+ "Host": self.BASE_URL,
21
+ "Connection": "Keep-Alive",
22
+ "Accept-Encoding": "gzip",
23
+ "Ccuccs2protocolsupport": self.ccu_ccs2_protocol_support,
24
+ "User-Agent": USER_AGENT_OK_HTTP,
25
+ }
@@ -17,10 +17,10 @@ import requests
17
17
  from dateutil import tz
18
18
 
19
19
  from .ApiImpl import (
20
- ApiImpl,
21
20
  ClimateRequestOptions,
22
21
  WindowRequestOptions,
23
22
  )
23
+ from .ApiImplType1 import ApiImplType1
24
24
  from .Token import Token
25
25
  from .Vehicle import (
26
26
  Vehicle,
@@ -96,7 +96,7 @@ def _check_response_for_errors(response: dict) -> None:
96
96
  raise APIError(f"Server returned: '{response['resMsg']}'")
97
97
 
98
98
 
99
- class KiaUvoApiAU(ApiImpl):
99
+ class KiaUvoApiAU(ApiImplType1):
100
100
  data_timezone = tz.gettz("Australia/Sydney")
101
101
  temperature_range = [x * 0.5 for x in range(34, 54)]
102
102
 
@@ -122,19 +122,6 @@ class KiaUvoApiAU(ApiImpl):
122
122
  self.SPA_API_URL_V2: str = "https://" + self.BASE_URL + "/api/v2/spa/"
123
123
  self.CLIENT_ID: str = self.CCSP_SERVICE_ID
124
124
 
125
- def _get_authenticated_headers(self, token: Token) -> dict:
126
- return {
127
- "Authorization": token.access_token,
128
- "ccsp-service-id": self.CCSP_SERVICE_ID,
129
- "ccsp-application-id": self.APP_ID,
130
- "ccsp-device-id": token.device_id,
131
- "Stamp": self._get_stamp(),
132
- "Host": self.BASE_URL,
133
- "Connection": "Keep-Alive",
134
- "Accept-Encoding": "gzip",
135
- "User-Agent": USER_AGENT_OK_HTTP,
136
- }
137
-
138
125
  def _get_control_headers(self, token: Token) -> dict:
139
126
  control_token, _ = self._get_control_token(token)
140
127
  authenticated_headers = self._get_authenticated_headers(token)
@@ -16,9 +16,10 @@ from bs4 import BeautifulSoup
16
16
  from dateutil import tz
17
17
 
18
18
  from .ApiImpl import (
19
- ApiImpl,
20
19
  ClimateRequestOptions,
21
20
  )
21
+ from .ApiImplType1 import ApiImplType1
22
+
22
23
  from .Token import Token
23
24
  from .Vehicle import (
24
25
  Vehicle,
@@ -98,7 +99,7 @@ def _check_response_for_errors(response: dict) -> None:
98
99
  raise APIError(f"Server returned: '{response['resMsg']}'")
99
100
 
100
101
 
101
- class KiaUvoApiCN(ApiImpl):
102
+ class KiaUvoApiCN(ApiImplType1):
102
103
  data_timezone = tz.gettz("Asia/Shanghai")
103
104
  temperature_range = [x * 0.5 for x in range(28, 60)]
104
105
 
@@ -17,9 +17,10 @@ from bs4 import BeautifulSoup
17
17
  from dateutil import tz
18
18
 
19
19
  from .ApiImpl import (
20
- ApiImpl,
21
20
  ClimateRequestOptions,
22
21
  )
22
+ from .ApiImplType1 import ApiImplType1
23
+
23
24
  from .Token import Token
24
25
  from .Vehicle import (
25
26
  Vehicle,
@@ -122,7 +123,7 @@ def _check_response_for_errors(response: dict) -> None:
122
123
  )
123
124
 
124
125
 
125
- class KiaUvoApiEU(ApiImpl):
126
+ class KiaUvoApiEU(ApiImplType1):
126
127
  data_timezone = tz.gettz("Europe/Berlin")
127
128
  temperature_range = [x * 0.5 for x in range(28, 60)]
128
129
 
@@ -226,20 +227,6 @@ class KiaUvoApiEU(ApiImpl):
226
227
  + "&state=$service_id:$user_id"
227
228
  )
228
229
 
229
- def _get_authenticated_headers(self, token: Token) -> dict:
230
- return {
231
- "Authorization": token.access_token,
232
- "ccsp-service-id": self.CCSP_SERVICE_ID,
233
- "ccsp-application-id": self.APP_ID,
234
- "Stamp": self._get_stamp(),
235
- "ccsp-device-id": token.device_id,
236
- "Host": self.BASE_URL,
237
- "Connection": "Keep-Alive",
238
- "Accept-Encoding": "gzip",
239
- "Ccuccs2protocolsupport": self.ccu_ccs2_protocol_support,
240
- "User-Agent": USER_AGENT_OK_HTTP,
241
- }
242
-
243
230
  def login(self, username: str, password: str) -> Token:
244
231
  stamp = self._get_stamp()
245
232
  device_id = self._get_device_id(stamp)
@@ -2,6 +2,7 @@
2
2
 
3
3
  # flake8: noqa
4
4
  from .ApiImpl import ApiImpl, ClimateRequestOptions, WindowRequestOptions
5
+ from .ApiImplType1 import ApiImplType1
5
6
  from .HyundaiBlueLinkAPIUSA import HyundaiBlueLinkAPIUSA
6
7
  from .KiaUvoApiCA import KiaUvoApiCA
7
8
  from .KiaUvoApiEU import KiaUvoApiEU
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hyundai_kia_connect_api
3
- Version: 3.17.7
3
+ Version: 3.17.9
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
@@ -20,6 +20,11 @@ Requires-Dist: curlify >=2.2.1
20
20
  Requires-Dist: python-dateutil
21
21
  Requires-Dist: pytz >=2021.3
22
22
 
23
+ Code Maintainers Wanted
24
+ =======================
25
+
26
+ I no longer have a Kia or Hyundai so don't maintain this like I used to. Others who are interested in jumping in are welcome to join the project! Even just pull requests are appreciated!
27
+
23
28
  Introduction
24
29
  ============
25
30
 
@@ -1,20 +1,21 @@
1
- hyundai_kia_connect_api/ApiImpl.py,sha256=1j5FRTQIILrSzQU6oE5i4J_l8cVvYuMGBmQn-kL7zyg,5018
1
+ hyundai_kia_connect_api/ApiImpl.py,sha256=8qy1OPFzPv2fvj513Eq7OwW8TWB3ZBffQwuuDA_kQB0,5155
2
+ hyundai_kia_connect_api/ApiImplType1.py,sha256=u6ulHCGw7bqkoOnqSUyDZHtXzf3QoXvlloMHGl9O-nM,754
2
3
  hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py,sha256=FVWDzmkO_jsc_r4WzufgxaJkeVYhf9UAw9A6r37b-Dc,26750
3
4
  hyundai_kia_connect_api/KiaUvoAPIUSA.py,sha256=kQo3PA_FktsAHhdugZi0lrpMcp96WNXcvBJPbIJIcfY,31217
4
- hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=ncAUEWqepHwYTZqu7JDNAozguucqqIg-HKPvpN_54CE,48738
5
+ hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=SjLjysqNJFGkeGW8eyds4n8Id0HnJsi_a8dRF_y0zdA,48280
5
6
  hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=7bcDLcJ3JLLoWldPy514eKhWUAo1Gb1mu_3SaXno4v8,30358
6
- hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=MjXdDdm1wDVvFZhgg8AjAF6X2SB-AIFMTE5iRmr80QM,47384
7
- hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=wwF0MnE_vsXrVwwBMH-LTuni8nXD672iYnIigVegIPI,69209
7
+ hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=iyciS-6v8QqwDkPj6D7lUAyR5dDylVApaZx6JKl4iNo,47416
8
+ hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=Q_w80aRyio5iWNP5mYoTha4DqVCdMbHrisJbLHKKY-g,68682
8
9
  hyundai_kia_connect_api/Token.py,sha256=ZsPvXh1ID7FUTGHAqhZUZyrKT7xVbOtIn6FRJn4Ygf0,370
9
10
  hyundai_kia_connect_api/Vehicle.py,sha256=jx8m3z9QRg9BvLLMT8wL0yD6jCnsA_w1nYE19Pm0bUo,13644
10
11
  hyundai_kia_connect_api/VehicleManager.py,sha256=JdJ8tUCVGciVC1SJubmMQqEZ7KXp6DlI_UiOQPkDeN4,9654
11
- hyundai_kia_connect_api/__init__.py,sha256=6UwXW6Lj5VnRtWNOt_0dLFdOYlcbysHCc6ol_XAC5YM,479
12
+ hyundai_kia_connect_api/__init__.py,sha256=nqODLee6fwh8EwA6gzRrTN8hQP1SBFqfYRmvMIQtT0w,518
12
13
  hyundai_kia_connect_api/const.py,sha256=C25jgV79u7SZF5xDy96gol_CekIkyI4h3goTyDEmng0,1967
13
14
  hyundai_kia_connect_api/exceptions.py,sha256=m7gyDnvA5OVAK4EXSP_ZwE0s0uV8HsGUV0tiYwqofK0,1343
14
15
  hyundai_kia_connect_api/utils.py,sha256=rfhERPXkzqelsaieLtiAyN9xDDTheNyKX5aBPRLrHf4,1117
15
- hyundai_kia_connect_api-3.17.7.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
16
- hyundai_kia_connect_api-3.17.7.dist-info/LICENSE,sha256=AsZwIRViAze7ObwO6V6IB0q4caXv6DJS2-3dsU1FWy8,1069
17
- hyundai_kia_connect_api-3.17.7.dist-info/METADATA,sha256=3N_FsIfSbVbuxz3W8iw3fk3DDlPL2b680qMONi-UyTk,5770
18
- hyundai_kia_connect_api-3.17.7.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
19
- hyundai_kia_connect_api-3.17.7.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
20
- hyundai_kia_connect_api-3.17.7.dist-info/RECORD,,
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,,