hyundai-kia-connect-api 3.17.6__py2.py3-none-any.whl → 3.17.8__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"""
@@ -1379,7 +1379,15 @@ class KiaUvoApiEU(ApiImpl):
1379
1379
  for drivingInfoItem in response30d["resMsg"]["drivingInfo"]:
1380
1380
  if (
1381
1381
  drivingInfoItem["drivingPeriod"] == 0
1382
- and drivingInfoItem["calculativeOdo"] > 0
1382
+ and next(
1383
+ (
1384
+ v
1385
+ for k, v in drivingInfoItem.items()
1386
+ if k.lower() == "calculativeodo"
1387
+ ),
1388
+ 0,
1389
+ )
1390
+ > 0
1383
1391
  ):
1384
1392
  drivingInfo["consumption30d"] = round(
1385
1393
  drivingInfoItem["totalPwrCsp"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hyundai_kia_connect_api
3
- Version: 3.17.6
3
+ Version: 3.17.8
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
@@ -1,10 +1,10 @@
1
- hyundai_kia_connect_api/ApiImpl.py,sha256=1j5FRTQIILrSzQU6oE5i4J_l8cVvYuMGBmQn-kL7zyg,5018
1
+ hyundai_kia_connect_api/ApiImpl.py,sha256=8qy1OPFzPv2fvj513Eq7OwW8TWB3ZBffQwuuDA_kQB0,5155
2
2
  hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py,sha256=FVWDzmkO_jsc_r4WzufgxaJkeVYhf9UAw9A6r37b-Dc,26750
3
3
  hyundai_kia_connect_api/KiaUvoAPIUSA.py,sha256=kQo3PA_FktsAHhdugZi0lrpMcp96WNXcvBJPbIJIcfY,31217
4
4
  hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=ncAUEWqepHwYTZqu7JDNAozguucqqIg-HKPvpN_54CE,48738
5
5
  hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=7bcDLcJ3JLLoWldPy514eKhWUAo1Gb1mu_3SaXno4v8,30358
6
6
  hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=MjXdDdm1wDVvFZhgg8AjAF6X2SB-AIFMTE5iRmr80QM,47384
7
- hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=jKIJ6B9BBfz6UyzlTH-RuWjuAr1ljrhOGsLwYGRXjlE,68960
7
+ hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=wwF0MnE_vsXrVwwBMH-LTuni8nXD672iYnIigVegIPI,69209
8
8
  hyundai_kia_connect_api/Token.py,sha256=ZsPvXh1ID7FUTGHAqhZUZyrKT7xVbOtIn6FRJn4Ygf0,370
9
9
  hyundai_kia_connect_api/Vehicle.py,sha256=jx8m3z9QRg9BvLLMT8wL0yD6jCnsA_w1nYE19Pm0bUo,13644
10
10
  hyundai_kia_connect_api/VehicleManager.py,sha256=JdJ8tUCVGciVC1SJubmMQqEZ7KXp6DlI_UiOQPkDeN4,9654
@@ -12,9 +12,9 @@ hyundai_kia_connect_api/__init__.py,sha256=6UwXW6Lj5VnRtWNOt_0dLFdOYlcbysHCc6ol_
12
12
  hyundai_kia_connect_api/const.py,sha256=C25jgV79u7SZF5xDy96gol_CekIkyI4h3goTyDEmng0,1967
13
13
  hyundai_kia_connect_api/exceptions.py,sha256=m7gyDnvA5OVAK4EXSP_ZwE0s0uV8HsGUV0tiYwqofK0,1343
14
14
  hyundai_kia_connect_api/utils.py,sha256=rfhERPXkzqelsaieLtiAyN9xDDTheNyKX5aBPRLrHf4,1117
15
- hyundai_kia_connect_api-3.17.6.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
16
- hyundai_kia_connect_api-3.17.6.dist-info/LICENSE,sha256=AsZwIRViAze7ObwO6V6IB0q4caXv6DJS2-3dsU1FWy8,1069
17
- hyundai_kia_connect_api-3.17.6.dist-info/METADATA,sha256=ckastDAh9Lnhzjiy0Y9ypxkXay-UxVslXFlpEZ9JIMA,5770
18
- hyundai_kia_connect_api-3.17.6.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
19
- hyundai_kia_connect_api-3.17.6.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
20
- hyundai_kia_connect_api-3.17.6.dist-info/RECORD,,
15
+ hyundai_kia_connect_api-3.17.8.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
16
+ hyundai_kia_connect_api-3.17.8.dist-info/LICENSE,sha256=AsZwIRViAze7ObwO6V6IB0q4caXv6DJS2-3dsU1FWy8,1069
17
+ hyundai_kia_connect_api-3.17.8.dist-info/METADATA,sha256=X_zOcTNE0C9frh4H4KNRh1MC6b0yuNbonx8cqoUTzHU,5770
18
+ hyundai_kia_connect_api-3.17.8.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
19
+ hyundai_kia_connect_api-3.17.8.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
20
+ hyundai_kia_connect_api-3.17.8.dist-info/RECORD,,