hyundai-kia-connect-api 3.22.0__py2.py3-none-any.whl → 3.22.2__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.
- hyundai_kia_connect_api/ApiImpl.py +5 -1
- hyundai_kia_connect_api/Vehicle.py +13 -3
- hyundai_kia_connect_api/utils.py +7 -0
- {hyundai_kia_connect_api-3.22.0.dist-info → hyundai_kia_connect_api-3.22.2.dist-info}/METADATA +1 -1
- {hyundai_kia_connect_api-3.22.0.dist-info → hyundai_kia_connect_api-3.22.2.dist-info}/RECORD +9 -9
- {hyundai_kia_connect_api-3.22.0.dist-info → hyundai_kia_connect_api-3.22.2.dist-info}/WHEEL +1 -1
- {hyundai_kia_connect_api-3.22.0.dist-info → hyundai_kia_connect_api-3.22.2.dist-info}/AUTHORS.rst +0 -0
- {hyundai_kia_connect_api-3.22.0.dist-info → hyundai_kia_connect_api-3.22.2.dist-info}/LICENSE +0 -0
- {hyundai_kia_connect_api-3.22.0.dist-info → hyundai_kia_connect_api-3.22.2.dist-info}/top_level.txt +0 -0
@@ -10,7 +10,7 @@ import requests
|
|
10
10
|
|
11
11
|
from .Token import Token
|
12
12
|
from .Vehicle import Vehicle
|
13
|
-
from .const import WINDOW_STATE, CHARGE_PORT_ACTION, OrderStatus
|
13
|
+
from .const import WINDOW_STATE, CHARGE_PORT_ACTION, OrderStatus, DOMAIN
|
14
14
|
from .utils import get_child_value
|
15
15
|
|
16
16
|
_LOGGER = logging.getLogger(__name__)
|
@@ -111,8 +111,12 @@ class ApiImpl:
|
|
111
111
|
+ "&format=json&addressdetails=1&zoom=18"
|
112
112
|
+ email_parameter
|
113
113
|
)
|
114
|
+
_LOGGER.debug(
|
115
|
+
f"{DOMAIN} - Running update geocode location with value: {url}"
|
116
|
+
)
|
114
117
|
response = requests.get(url)
|
115
118
|
response = response.json()
|
119
|
+
_LOGGER.debug(f"{DOMAIN} - geocode location response: {response}")
|
116
120
|
vehicle.geocode = (
|
117
121
|
get_child_value(response, "display_name"),
|
118
122
|
get_child_value(response, "address"),
|
@@ -6,7 +6,7 @@ import datetime
|
|
6
6
|
import typing
|
7
7
|
from dataclasses import dataclass, field
|
8
8
|
|
9
|
-
from .utils import get_float
|
9
|
+
from .utils import get_float, get_safe_local_datetime
|
10
10
|
from .const import DISTANCE_UNITS
|
11
11
|
|
12
12
|
_LOGGER = logging.getLogger(__name__)
|
@@ -94,8 +94,10 @@ class Vehicle:
|
|
94
94
|
|
95
95
|
car_battery_percentage: int = None
|
96
96
|
engine_is_running: bool = None
|
97
|
-
|
97
|
+
|
98
|
+
_last_updated_at: datetime.datetime = None
|
98
99
|
timezone: datetime.timezone = datetime.timezone.utc # default UTC
|
100
|
+
|
99
101
|
dtc_count: typing.Union[int, None] = None
|
100
102
|
dtc_descriptions: typing.Union[dict, None] = None
|
101
103
|
|
@@ -298,6 +300,14 @@ class Vehicle:
|
|
298
300
|
self._last_service_distance_unit = value[1]
|
299
301
|
self._last_service_distance = value[0]
|
300
302
|
|
303
|
+
@property
|
304
|
+
def last_updated_at(self):
|
305
|
+
return self._last_updated_at
|
306
|
+
|
307
|
+
@last_updated_at.setter
|
308
|
+
def last_updated_at(self, value):
|
309
|
+
self._last_updated_at = get_safe_local_datetime(value)
|
310
|
+
|
301
311
|
@property
|
302
312
|
def location_latitude(self):
|
303
313
|
return self._location_latitude
|
@@ -323,7 +333,7 @@ class Vehicle:
|
|
323
333
|
def location(self, value):
|
324
334
|
self._location_latitude = value[0]
|
325
335
|
self._location_longitude = value[1]
|
326
|
-
self._location_last_set_time = value[2]
|
336
|
+
self._location_last_set_time = get_safe_local_datetime(value[2])
|
327
337
|
|
328
338
|
@property
|
329
339
|
def odometer(self):
|
hyundai_kia_connect_api/utils.py
CHANGED
@@ -67,3 +67,10 @@ def parse_datetime(value, timezone) -> datetime.datetime:
|
|
67
67
|
second=int(m.group(6)),
|
68
68
|
tzinfo=timezone,
|
69
69
|
)
|
70
|
+
|
71
|
+
|
72
|
+
def get_safe_local_datetime(date: datetime) -> datetime:
|
73
|
+
"""get safe local datetime"""
|
74
|
+
if date is not None and hasattr(date, "tzinfo") and date.tzinfo is not None:
|
75
|
+
date = date.astimezone()
|
76
|
+
return date
|
{hyundai_kia_connect_api-3.22.0.dist-info → hyundai_kia_connect_api-3.22.2.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: hyundai_kia_connect_api
|
3
|
-
Version: 3.22.
|
3
|
+
Version: 3.22.2
|
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
|
{hyundai_kia_connect_api-3.22.0.dist-info → hyundai_kia_connect_api-3.22.2.dist-info}/RECORD
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
hyundai_kia_connect_api/ApiImpl.py,sha256=
|
1
|
+
hyundai_kia_connect_api/ApiImpl.py,sha256=IA7gt43NmYUQqwW_GhHBYKxjczqA1qqqf6xKIC3LJoE,6399
|
2
2
|
hyundai_kia_connect_api/ApiImplType1.py,sha256=-TwcG1wibYmQ96lK_rTl-O1Wh0Kd-Zi5d1tS59uSRwQ,12176
|
3
3
|
hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py,sha256=cmp99_BaF7XluTrIo8UssV1U_JbvMxzQnu_RJfpv7NQ,28659
|
4
4
|
hyundai_kia_connect_api/KiaUvoAPIUSA.py,sha256=llCsBbefkfZMzu4Vz4KXk-1FDZfLTPDelAN2kxaC4hA,31115
|
@@ -7,15 +7,15 @@ hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=F2OI52H2bpX4hDHRrbjWt2Y6iODu7iIEfx
|
|
7
7
|
hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=cW9YRmt5CPUTB9dHEO7B1ev8SnLjeyzuLN9o50V7JXc,46852
|
8
8
|
hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=6RGVHoDpegx1wT_SfMNp99HGII-9CUr1ziF_V3mStPs,68755
|
9
9
|
hyundai_kia_connect_api/Token.py,sha256=ZsPvXh1ID7FUTGHAqhZUZyrKT7xVbOtIn6FRJn4Ygf0,370
|
10
|
-
hyundai_kia_connect_api/Vehicle.py,sha256=
|
10
|
+
hyundai_kia_connect_api/Vehicle.py,sha256=Gaux63hYW0Lwfr2dtqlXUYbNwranUIiGaAT0Xh0nsFo,16028
|
11
11
|
hyundai_kia_connect_api/VehicleManager.py,sha256=b-umPTBNFn5gmJcXQr7Qi978UVTJQrWhp_r15HdMOuw,10156
|
12
12
|
hyundai_kia_connect_api/__init__.py,sha256=i2kXYjBEKSvT1e8FoQ7V7oqAyL22w3XzF2rAFpyietc,578
|
13
13
|
hyundai_kia_connect_api/const.py,sha256=ofi_ZfGxJYo0FWIcGFbIMSMRdKRtaK4GUDhFiQRvZeI,2007
|
14
14
|
hyundai_kia_connect_api/exceptions.py,sha256=m7gyDnvA5OVAK4EXSP_ZwE0s0uV8HsGUV0tiYwqofK0,1343
|
15
|
-
hyundai_kia_connect_api/utils.py,sha256=
|
16
|
-
hyundai_kia_connect_api-3.22.
|
17
|
-
hyundai_kia_connect_api-3.22.
|
18
|
-
hyundai_kia_connect_api-3.22.
|
19
|
-
hyundai_kia_connect_api-3.22.
|
20
|
-
hyundai_kia_connect_api-3.22.
|
21
|
-
hyundai_kia_connect_api-3.22.
|
15
|
+
hyundai_kia_connect_api/utils.py,sha256=WnFAb5iqFIjXAPnA--fxAcqsONcLLgxkU2uJn3xd5Kc,1934
|
16
|
+
hyundai_kia_connect_api-3.22.2.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
|
17
|
+
hyundai_kia_connect_api-3.22.2.dist-info/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
|
18
|
+
hyundai_kia_connect_api-3.22.2.dist-info/METADATA,sha256=r4jQie0Xz9WocikCH6-4EiLRgY2n4HnC9sIRuhWRDBY,6045
|
19
|
+
hyundai_kia_connect_api-3.22.2.dist-info/WHEEL,sha256=Bg2tc0y2BWmjPleo_9t49Eo5MV2MiaNGRw6ZlQNGo9o,109
|
20
|
+
hyundai_kia_connect_api-3.22.2.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
|
21
|
+
hyundai_kia_connect_api-3.22.2.dist-info/RECORD,,
|
{hyundai_kia_connect_api-3.22.0.dist-info → hyundai_kia_connect_api-3.22.2.dist-info}/AUTHORS.rst
RENAMED
File without changes
|
{hyundai_kia_connect_api-3.22.0.dist-info → hyundai_kia_connect_api-3.22.2.dist-info}/LICENSE
RENAMED
File without changes
|
{hyundai_kia_connect_api-3.22.0.dist-info → hyundai_kia_connect_api-3.22.2.dist-info}/top_level.txt
RENAMED
File without changes
|