hyundai-kia-connect-api 3.39.0__py2.py3-none-any.whl → 3.40.1__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/ApiImplType1.py +5 -0
- hyundai_kia_connect_api/KiaUvoApiCA.py +28 -1
- hyundai_kia_connect_api/KiaUvoApiEU.py +7 -23
- {hyundai_kia_connect_api-3.39.0.dist-info → hyundai_kia_connect_api-3.40.1.dist-info}/METADATA +1 -1
- {hyundai_kia_connect_api-3.39.0.dist-info → hyundai_kia_connect_api-3.40.1.dist-info}/RECORD +10 -10
- {hyundai_kia_connect_api-3.39.0.dist-info → hyundai_kia_connect_api-3.40.1.dist-info}/WHEEL +1 -1
- {hyundai_kia_connect_api-3.39.0.dist-info → hyundai_kia_connect_api-3.40.1.dist-info}/entry_points.txt +0 -0
- {hyundai_kia_connect_api-3.39.0.dist-info → hyundai_kia_connect_api-3.40.1.dist-info}/licenses/AUTHORS.rst +0 -0
- {hyundai_kia_connect_api-3.39.0.dist-info → hyundai_kia_connect_api-3.40.1.dist-info}/licenses/LICENSE +0 -0
- {hyundai_kia_connect_api-3.39.0.dist-info → hyundai_kia_connect_api-3.40.1.dist-info}/top_level.txt +0 -0
@@ -443,6 +443,11 @@ class ApiImplType1(ApiImpl):
|
|
443
443
|
get_child_value(state, "Electronics.FOB.LowBattery")
|
444
444
|
)
|
445
445
|
|
446
|
+
if vehicle._ev_estimated_current_charge_duration == 0:
|
447
|
+
vehicle.ev_battery_is_charging = False
|
448
|
+
elif vehicle._ev_estimated_current_charge_duration > 0:
|
449
|
+
vehicle.ev_battery_is_charging = True
|
450
|
+
|
446
451
|
if get_child_value(state, "Location.GeoCoord.Latitude"):
|
447
452
|
location_last_updated_at = dt.datetime(
|
448
453
|
2000, 1, 1, tzinfo=self.data_timezone
|
@@ -13,7 +13,7 @@ from dateutil.tz import tzoffset
|
|
13
13
|
|
14
14
|
from .ApiImpl import ApiImpl, ClimateRequestOptions
|
15
15
|
from .Token import Token
|
16
|
-
from .Vehicle import Vehicle
|
16
|
+
from .Vehicle import Vehicle, DailyDrivingStats
|
17
17
|
from .const import (
|
18
18
|
BRAND_GENESIS,
|
19
19
|
BRAND_HYUNDAI,
|
@@ -202,6 +202,7 @@ class KiaUvoApiCA(ApiImpl):
|
|
202
202
|
if vehicle.engine_type == ENGINE_TYPES.EV:
|
203
203
|
charge = self._get_charge_limits(token, vehicle)
|
204
204
|
self._update_vehicle_properties_charge(vehicle, charge)
|
205
|
+
self._update_vehicle_properties_trip_details(token, vehicle)
|
205
206
|
|
206
207
|
def force_refresh_vehicle_state(self, token: Token, vehicle: Vehicle) -> None:
|
207
208
|
state = self._get_forced_vehicle_state(token, vehicle)
|
@@ -240,6 +241,7 @@ class KiaUvoApiCA(ApiImpl):
|
|
240
241
|
if vehicle.engine_type == ENGINE_TYPES.EV:
|
241
242
|
charge = self._get_charge_limits(token, vehicle)
|
242
243
|
self._update_vehicle_properties_charge(vehicle, charge)
|
244
|
+
self._update_vehicle_properties_trip_details(token, vehicle)
|
243
245
|
|
244
246
|
def _update_vehicle_properties_base(self, vehicle: Vehicle, state: dict) -> None:
|
245
247
|
_LOGGER.debug(f"{DOMAIN} - Old Vehicle Last Updated: {vehicle.last_updated_at}")
|
@@ -440,6 +442,31 @@ class KiaUvoApiCA(ApiImpl):
|
|
440
442
|
)
|
441
443
|
vehicle.data["vehicleLocation"] = state
|
442
444
|
|
445
|
+
def _update_vehicle_properties_trip_details(self, token: Token, vehicle: Vehicle):
|
446
|
+
url = self.API_URL + "alerts/maintenance/evTripDetails"
|
447
|
+
headers = self.API_HEADERS
|
448
|
+
headers["accessToken"] = token.access_token
|
449
|
+
headers["vehicleId"] = vehicle.id
|
450
|
+
|
451
|
+
response = self.sessions.post(url, headers=headers)
|
452
|
+
response = response.json()
|
453
|
+
_LOGGER.debug(f"{DOMAIN} - Received get_ev_details response {response}")
|
454
|
+
tripStats = []
|
455
|
+
for trip in response["result"]["tripdetails"]:
|
456
|
+
processedTrip = DailyDrivingStats(
|
457
|
+
date=dt.datetime.strptime(trip["startdate"], "%Y-%m-%d %H:%M:%S"),
|
458
|
+
total_consumed=get_child_value(trip, "totalused"),
|
459
|
+
engine_consumption=get_child_value(trip, "drivetrain"),
|
460
|
+
climate_consumption=get_child_value(trip, "climate"),
|
461
|
+
onboard_electronics_consumption=get_child_value(trip, "accessories"),
|
462
|
+
battery_care_consumption=get_child_value(trip, "batterycare"),
|
463
|
+
regenerated_energy=get_child_value(trip, "regen"),
|
464
|
+
distance=get_child_value(trip, "distance"),
|
465
|
+
distance_unit=vehicle.odometer_unit,
|
466
|
+
)
|
467
|
+
tripStats.append(processedTrip)
|
468
|
+
vehicle.daily_stats = tripStats
|
469
|
+
|
443
470
|
def _get_cached_vehicle_state(self, token: Token, vehicle: Vehicle) -> dict:
|
444
471
|
# Vehicle Status Call
|
445
472
|
url = self.API_URL + "lstvhclsts"
|
@@ -790,30 +790,14 @@ class KiaUvoApiEU(ApiImplType1):
|
|
790
790
|
def charge_port_action(
|
791
791
|
self, token: Token, vehicle: Vehicle, action: CHARGE_PORT_ACTION
|
792
792
|
) -> str:
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
793
|
+
url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/control/portdoor"
|
794
|
+
|
795
|
+
payload = {"action": action.value}
|
796
|
+
_LOGGER.debug(f"{DOMAIN} - Charge Port Action Request: {payload}")
|
797
|
+
response = requests.post(
|
798
|
+
url, json=payload, headers=self._get_control_headers(token, vehicle)
|
799
|
+
).json()
|
800
800
|
|
801
|
-
payload = {"command": action.value}
|
802
|
-
_LOGGER.debug(f"{DOMAIN} - Charge Port Action Request: {payload}")
|
803
|
-
response = requests.post(
|
804
|
-
url, json=payload, headers=self._get_control_headers(token, vehicle)
|
805
|
-
).json()
|
806
|
-
else:
|
807
|
-
url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/control/portdoor"
|
808
|
-
payload = {"action": action.value}
|
809
|
-
_LOGGER.debug(f"{DOMAIN} - Charge Port Action Request: {payload}")
|
810
|
-
response = requests.post(
|
811
|
-
url,
|
812
|
-
json=payload,
|
813
|
-
headers=self._get_authenticated_headers(
|
814
|
-
token, vehicle.ccu_ccs2_protocol_support
|
815
|
-
),
|
816
|
-
).json()
|
817
801
|
_LOGGER.debug(f"{DOMAIN} - Charge Port Action Response: {response}")
|
818
802
|
_check_response_for_errors(response)
|
819
803
|
token.device_id = self._get_device_id(self._get_stamp())
|
{hyundai_kia_connect_api-3.39.0.dist-info → hyundai_kia_connect_api-3.40.1.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hyundai_kia_connect_api
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.40.1
|
4
4
|
Summary: Python Boilerplate contains all the boilerplate you need to create a Python package.
|
5
5
|
Home-page: https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api
|
6
6
|
Author: Fuat Akgun
|
{hyundai_kia_connect_api-3.39.0.dist-info → hyundai_kia_connect_api-3.40.1.dist-info}/RECORD
RENAMED
@@ -1,10 +1,10 @@
|
|
1
1
|
hyundai_kia_connect_api/ApiImpl.py,sha256=UeG2FH4KCdU5LvGp5Ks793vrWbwBx8MN_DedbVRRouM,9612
|
2
|
-
hyundai_kia_connect_api/ApiImplType1.py,sha256=
|
2
|
+
hyundai_kia_connect_api/ApiImplType1.py,sha256=qYOnM7aT7Y1csYZ1VrJJC3TtB5PSq13kC90i_q-gKtQ,38121
|
3
3
|
hyundai_kia_connect_api/HyundaiBlueLinkApiUSA.py,sha256=TNuFJIZ6Kpd5vbV5rVJjcqp7z-Ys3blzsz6YYWZThiA,36710
|
4
4
|
hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=433Db-rp3drhyY8ZvN-GiVP85pl90Wwu4A2uAdkYH1c,36100
|
5
|
-
hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=
|
5
|
+
hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=qZsHdXnxAr9N3FnF6IxpnKbSkv1fHbCDcfDLLbZLm5Q,33784
|
6
6
|
hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=WP-rRI3wZmjuLYZmPXeOSk2NNNc6UhTrpOMuYMG6-iE,47043
|
7
|
-
hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=
|
7
|
+
hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=ZV3yWd4W-zyN-xS6o_ItQtedLAkEvk5C_yTHGvT2qqU,50172
|
8
8
|
hyundai_kia_connect_api/KiaUvoApiIN.py,sha256=q17gaDhp38wJwn1ceTou1QcDiuDW2wGGjOFTMDRROl8,36318
|
9
9
|
hyundai_kia_connect_api/KiaUvoApiUSA.py,sha256=DeA-a2qq78XPYGB8U4vzy2oAcCQJ1xJRN9tlAK_I94o,30404
|
10
10
|
hyundai_kia_connect_api/Token.py,sha256=ZsPvXh1ID7FUTGHAqhZUZyrKT7xVbOtIn6FRJn4Ygf0,370
|
@@ -15,10 +15,10 @@ hyundai_kia_connect_api/bluelink.py,sha256=JiNIHl-Qi8zwqyN6ywKg5CdXOLT74WkvpjVcn
|
|
15
15
|
hyundai_kia_connect_api/const.py,sha256=ImISRt4QarbN8BOBlDGYRB3F69NKCcGu8ddFvNPhhXU,2370
|
16
16
|
hyundai_kia_connect_api/exceptions.py,sha256=m7gyDnvA5OVAK4EXSP_ZwE0s0uV8HsGUV0tiYwqofK0,1343
|
17
17
|
hyundai_kia_connect_api/utils.py,sha256=J0aXUX-nKIoS3XbelatNh-DZlHRU2_DYz_Mg_ZUKQJU,1957
|
18
|
-
hyundai_kia_connect_api-3.
|
19
|
-
hyundai_kia_connect_api-3.
|
20
|
-
hyundai_kia_connect_api-3.
|
21
|
-
hyundai_kia_connect_api-3.
|
22
|
-
hyundai_kia_connect_api-3.
|
23
|
-
hyundai_kia_connect_api-3.
|
24
|
-
hyundai_kia_connect_api-3.
|
18
|
+
hyundai_kia_connect_api-3.40.1.dist-info/licenses/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
|
19
|
+
hyundai_kia_connect_api-3.40.1.dist-info/licenses/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
|
20
|
+
hyundai_kia_connect_api-3.40.1.dist-info/METADATA,sha256=PnlhBIU5_km7dQ49N319PVHOVbBcLJ49Dli7avtIL6A,7156
|
21
|
+
hyundai_kia_connect_api-3.40.1.dist-info/WHEEL,sha256=XAkygS4h1cf0JYWV13kJhTWht2y9NqKAsZuiTHc2920,109
|
22
|
+
hyundai_kia_connect_api-3.40.1.dist-info/entry_points.txt,sha256=XfrroRdyC_9q9VXjEZe5SdRPhkQyCCE4S7ZK6XSKelA,67
|
23
|
+
hyundai_kia_connect_api-3.40.1.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
|
24
|
+
hyundai_kia_connect_api-3.40.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
{hyundai_kia_connect_api-3.39.0.dist-info → hyundai_kia_connect_api-3.40.1.dist-info}/top_level.txt
RENAMED
File without changes
|