hyundai-kia-connect-api 3.23.9__py2.py3-none-any.whl → 3.24.0__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/HyundaiBlueLinkAPIUSA.py +30 -1
- hyundai_kia_connect_api/Vehicle.py +2 -4
- hyundai_kia_connect_api/__init__.py +0 -7
- {hyundai_kia_connect_api-3.23.9.dist-info → hyundai_kia_connect_api-3.24.0.dist-info}/METADATA +1 -1
- {hyundai_kia_connect_api-3.23.9.dist-info → hyundai_kia_connect_api-3.24.0.dist-info}/RECORD +9 -9
- {hyundai_kia_connect_api-3.23.9.dist-info → hyundai_kia_connect_api-3.24.0.dist-info}/WHEEL +1 -1
- {hyundai_kia_connect_api-3.23.9.dist-info → hyundai_kia_connect_api-3.24.0.dist-info}/AUTHORS.rst +0 -0
- {hyundai_kia_connect_api-3.23.9.dist-info → hyundai_kia_connect_api-3.24.0.dist-info}/LICENSE +0 -0
- {hyundai_kia_connect_api-3.23.9.dist-info → hyundai_kia_connect_api-3.24.0.dist-info}/top_level.txt +0 -0
@@ -12,6 +12,8 @@ import certifi
|
|
12
12
|
from requests.adapters import HTTPAdapter
|
13
13
|
from urllib3.util.ssl_ import create_urllib3_context
|
14
14
|
|
15
|
+
from hyundai_kia_connect_api.exceptions import APIError
|
16
|
+
|
15
17
|
from .const import (
|
16
18
|
DOMAIN,
|
17
19
|
VEHICLE_LOCK_ACTION,
|
@@ -459,6 +461,31 @@ class HyundaiBlueLinkAPIUSA(ApiImpl):
|
|
459
461
|
# fill vehicle.daily_stats
|
460
462
|
tripStats = []
|
461
463
|
tripDetails = get_child_value(state, "evTripDetails.tripdetails") or {}
|
464
|
+
|
465
|
+
# compute more digits for distance mileage using odometer and overrule distance
|
466
|
+
previous_odometer = None
|
467
|
+
for trip in reversed(tripDetails):
|
468
|
+
odometer = get_child_value(trip, "odometer.value")
|
469
|
+
if previous_odometer and odometer:
|
470
|
+
delta_odometer = odometer - previous_odometer
|
471
|
+
if delta_odometer >= 0.0:
|
472
|
+
trip["distance"] = delta_odometer
|
473
|
+
previous_odometer = odometer
|
474
|
+
|
475
|
+
# overrule odometer with more accuracy from last trip
|
476
|
+
if (
|
477
|
+
previous_odometer
|
478
|
+
and vehicle.odometer
|
479
|
+
and previous_odometer > vehicle.odometer
|
480
|
+
):
|
481
|
+
_LOGGER.debug(
|
482
|
+
f"Overruling odometer: {previous_odometer:.1f} old: {vehicle.odometer:.1f}" # noqa
|
483
|
+
)
|
484
|
+
vehicle.odometer = (
|
485
|
+
previous_odometer,
|
486
|
+
DISTANCE_UNITS[3],
|
487
|
+
)
|
488
|
+
|
462
489
|
for trip in tripDetails:
|
463
490
|
processedTrip = DailyDrivingStats(
|
464
491
|
date=dt.datetime.strptime(trip["startdate"], "%Y-%m-%d %H:%M:%S.%f"),
|
@@ -485,7 +512,7 @@ class HyundaiBlueLinkAPIUSA(ApiImpl):
|
|
485
512
|
hhmmss=yyyymmdd_hhmmss,
|
486
513
|
drive_time=int(drive_time / 60), # convert seconds to minutes
|
487
514
|
idle_time=int(idle_time / 60), # convert seconds to minutes
|
488
|
-
distance=
|
515
|
+
distance=float(trip["distance"]),
|
489
516
|
avg_speed=get_child_value(trip["avgspeed"], "value"),
|
490
517
|
max_speed=int(get_child_value(trip["maxspeed"], "value")),
|
491
518
|
)
|
@@ -733,6 +760,8 @@ class HyundaiBlueLinkAPIUSA(ApiImpl):
|
|
733
760
|
elif action == VEHICLE_LOCK_ACTION.UNLOCK:
|
734
761
|
url = self.API_URL + "rcs/rdo/on"
|
735
762
|
_LOGGER.debug(f"{DOMAIN} - Calling unlock")
|
763
|
+
else:
|
764
|
+
raise APIError(f"Invalid action value: {action}")
|
736
765
|
|
737
766
|
headers = self._get_vehicle_headers(token, vehicle)
|
738
767
|
headers["APPCLOUD-VIN"] = vehicle.VIN
|
@@ -19,7 +19,7 @@ class TripInfo:
|
|
19
19
|
hhmmss: str = None # will not be filled by summary
|
20
20
|
drive_time: int = None # minutes
|
21
21
|
idle_time: int = None # minutes
|
22
|
-
distance:
|
22
|
+
distance: float = None
|
23
23
|
avg_speed: float = None
|
24
24
|
max_speed: int = None
|
25
25
|
|
@@ -60,9 +60,7 @@ class DailyDrivingStats:
|
|
60
60
|
onboard_electronics_consumption: int = None
|
61
61
|
battery_care_consumption: int = None
|
62
62
|
regenerated_energy: int = None
|
63
|
-
|
64
|
-
# configured in. KMs (rounded) in my case
|
65
|
-
distance: int = None
|
63
|
+
distance: float = None
|
66
64
|
distance_unit: str = DISTANCE_UNITS[1] # set to kms by default
|
67
65
|
|
68
66
|
|
@@ -2,17 +2,10 @@
|
|
2
2
|
|
3
3
|
# flake8: noqa
|
4
4
|
from .ApiImpl import (
|
5
|
-
ApiImpl,
|
6
5
|
ClimateRequestOptions,
|
7
6
|
WindowRequestOptions,
|
8
7
|
ScheduleChargingClimateRequestOptions,
|
9
8
|
)
|
10
|
-
from .ApiImplType1 import ApiImplType1
|
11
|
-
from .HyundaiBlueLinkAPIUSA import HyundaiBlueLinkAPIUSA
|
12
|
-
from .KiaUvoApiCA import KiaUvoApiCA
|
13
|
-
from .KiaUvoApiEU import KiaUvoApiEU
|
14
|
-
from .KiaUvoAPIUSA import KiaUvoAPIUSA
|
15
|
-
from .KiaUvoApiCN import KiaUvoApiCN
|
16
9
|
|
17
10
|
from .Token import Token
|
18
11
|
from .Vehicle import Vehicle
|
{hyundai_kia_connect_api-3.23.9.dist-info → hyundai_kia_connect_api-3.24.0.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: hyundai_kia_connect_api
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.24.0
|
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.23.9.dist-info → hyundai_kia_connect_api-3.24.0.dist-info}/RECORD
RENAMED
@@ -1,21 +1,21 @@
|
|
1
1
|
hyundai_kia_connect_api/ApiImpl.py,sha256=7tB6PZTEVlw-GCfEjU4ekq_ZgnFseYLrEYpbUyEoL84,6866
|
2
2
|
hyundai_kia_connect_api/ApiImplType1.py,sha256=PnKwpbCoYGOXBWzBLIlDSrC6daIYeW9qlfW7TM4HCU0,12184
|
3
|
-
hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py,sha256=
|
3
|
+
hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py,sha256=MK1cFcnuZebogz32-nXjHt0pAgQ1-2lrurw8SADX6ww,36690
|
4
4
|
hyundai_kia_connect_api/KiaUvoAPIUSA.py,sha256=FmRc7bAmsOz9jBtWSAb8lD0ybRMN0OgfEPZZJbPhMUw,31292
|
5
5
|
hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=Mzw0Ov5la4mQvWOXWYpvAfrM6l2BSBEusaPFsL3kn2I,48127
|
6
6
|
hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=B3Lks_ONr3l01QLl-GQBPdktXj9PZWKuQKRLYmJ7kP4,30763
|
7
7
|
hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=cwIPZ0dU6HolKdooUQeQKlLAic6YU8dQmNs0VQDBgpQ,47035
|
8
8
|
hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=_wNkctkIO2hrf1K2LTZPtHWZ5ewTcXqTv0s_AXRXI2I,68254
|
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=M95Eq1vK-th5se7dZHEDcTOM1b19GIjpecyw2MKykQ8,18639
|
11
11
|
hyundai_kia_connect_api/VehicleManager.py,sha256=REny83eNXERAcnw8qrBZ9dh6qODCvd5Z_jmSY2JtXvY,10196
|
12
|
-
hyundai_kia_connect_api/__init__.py,sha256=
|
12
|
+
hyundai_kia_connect_api/__init__.py,sha256=IkyVeIMbcFJZgLaiiNnUVA1Ferxvrm1bXHKVg01cxvc,319
|
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
15
|
hyundai_kia_connect_api/utils.py,sha256=J0aXUX-nKIoS3XbelatNh-DZlHRU2_DYz_Mg_ZUKQJU,1957
|
16
|
-
hyundai_kia_connect_api-3.
|
17
|
-
hyundai_kia_connect_api-3.
|
18
|
-
hyundai_kia_connect_api-3.
|
19
|
-
hyundai_kia_connect_api-3.
|
20
|
-
hyundai_kia_connect_api-3.
|
21
|
-
hyundai_kia_connect_api-3.
|
16
|
+
hyundai_kia_connect_api-3.24.0.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
|
17
|
+
hyundai_kia_connect_api-3.24.0.dist-info/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
|
18
|
+
hyundai_kia_connect_api-3.24.0.dist-info/METADATA,sha256=0rSDOZXPXAEl9DWh4K8tYoiPulu3WMSWaMy4vI_hkeY,6069
|
19
|
+
hyundai_kia_connect_api-3.24.0.dist-info/WHEEL,sha256=OpXWERl2xLPRHTvd2ZXo_iluPEQd8uSbYkJ53NAER_Y,109
|
20
|
+
hyundai_kia_connect_api-3.24.0.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
|
21
|
+
hyundai_kia_connect_api-3.24.0.dist-info/RECORD,,
|
{hyundai_kia_connect_api-3.23.9.dist-info → hyundai_kia_connect_api-3.24.0.dist-info}/AUTHORS.rst
RENAMED
File without changes
|
{hyundai_kia_connect_api-3.23.9.dist-info → hyundai_kia_connect_api-3.24.0.dist-info}/LICENSE
RENAMED
File without changes
|
{hyundai_kia_connect_api-3.23.9.dist-info → hyundai_kia_connect_api-3.24.0.dist-info}/top_level.txt
RENAMED
File without changes
|