hyundai-kia-connect-api 3.40.4__py2.py3-none-any.whl → 3.40.5__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.
@@ -443,7 +443,7 @@ class ApiImplType1(ApiImpl):
443
443
  vehicle.smart_key_battery_warning_is_on = bool(
444
444
  get_child_value(state, "Electronics.FOB.LowBattery")
445
445
  )
446
- if vehicle._ev_estimated_current_charge_duration is None:
446
+ if vehicle._ev_estimated_current_charge_duration is not None:
447
447
  if vehicle._ev_estimated_current_charge_duration == 0:
448
448
  vehicle.ev_battery_is_charging = False
449
449
  elif vehicle._ev_estimated_current_charge_duration > 0:
@@ -449,23 +449,39 @@ class KiaUvoApiCA(ApiImpl):
449
449
  headers["vehicleId"] = vehicle.id
450
450
 
451
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,
452
+ if response.ok:
453
+ response = response.json()
454
+ _LOGGER.debug(
455
+ f"{DOMAIN} - Received _update_vehicle_properties_trip_details response {response}"
456
+ )
457
+ if "result" in response and "tripdetails" in response["result"]:
458
+ trip_stats = []
459
+ for trip in response["result"]["tripdetails"]:
460
+ processed_trip = DailyDrivingStats(
461
+ date=dt.datetime.strptime(
462
+ trip["startdate"], "%Y-%m-%d %H:%M:%S"
463
+ ),
464
+ total_consumed=get_child_value(trip, "totalused"),
465
+ engine_consumption=get_child_value(trip, "drivetrain"),
466
+ climate_consumption=get_child_value(trip, "climate"),
467
+ onboard_electronics_consumption=get_child_value(
468
+ trip, "accessories"
469
+ ),
470
+ battery_care_consumption=get_child_value(trip, "batterycare"),
471
+ regenerated_energy=get_child_value(trip, "regen"),
472
+ distance=get_child_value(trip, "distance"),
473
+ distance_unit=vehicle.odometer_unit,
474
+ )
475
+ trip_stats.append(processed_trip)
476
+ vehicle.daily_stats = trip_stats
477
+ else:
478
+ _LOGGER.debug(
479
+ f"{DOMAIN} - Error with _update_vehicle_properties_trip_details response. Unknown format: {response}"
480
+ )
481
+ else:
482
+ _LOGGER.debug(
483
+ f"{DOMAIN} - Error with _update_vehicle_properties_trip_details response: {response.text}"
466
484
  )
467
- tripStats.append(processedTrip)
468
- vehicle.daily_stats = tripStats
469
485
 
470
486
  def _get_cached_vehicle_state(self, token: Token, vehicle: Vehicle) -> dict:
471
487
  # Vehicle Status Call
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyundai_kia_connect_api
3
- Version: 3.40.4
3
+ Version: 3.40.5
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
@@ -1,8 +1,8 @@
1
1
  hyundai_kia_connect_api/ApiImpl.py,sha256=UeG2FH4KCdU5LvGp5Ks793vrWbwBx8MN_DedbVRRouM,9612
2
- hyundai_kia_connect_api/ApiImplType1.py,sha256=N4xNKM-5WA4zD9d00Nvf5GuGSymbFNAIyY8xtduH4oc,38324
2
+ hyundai_kia_connect_api/ApiImplType1.py,sha256=i6ih6tBclPHfA00jQvUPG3tBwy9AY4oiGdaO-jCOZ6A,38328
3
3
  hyundai_kia_connect_api/HyundaiBlueLinkApiUSA.py,sha256=dg4r6cI38bFuX-vcI76N0kByKVUNZUlSZ8Jp_68xnAM,37079
4
4
  hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=433Db-rp3drhyY8ZvN-GiVP85pl90Wwu4A2uAdkYH1c,36100
5
- hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=qZsHdXnxAr9N3FnF6IxpnKbSkv1fHbCDcfDLLbZLm5Q,33784
5
+ hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=eGg9yK8Am4zCVpyC9I3AnnbgTL7QbOigm0ttfWZ5K4w,34532
6
6
  hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=WP-rRI3wZmjuLYZmPXeOSk2NNNc6UhTrpOMuYMG6-iE,47043
7
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
@@ -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=0dwKEPXN8KQVTeueDj2fL3E-TQMU7LjTEJbhcq8Mjx8,1467
17
17
  hyundai_kia_connect_api/utils.py,sha256=J0aXUX-nKIoS3XbelatNh-DZlHRU2_DYz_Mg_ZUKQJU,1957
18
- hyundai_kia_connect_api-3.40.4.dist-info/licenses/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
19
- hyundai_kia_connect_api-3.40.4.dist-info/licenses/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
20
- hyundai_kia_connect_api-3.40.4.dist-info/METADATA,sha256=YxA3Nh6yTqsOHW5PkjhHFxv9n-O0_MxMJYvVZMKi34c,7156
21
- hyundai_kia_connect_api-3.40.4.dist-info/WHEEL,sha256=_itY3bZllKbLk93i0gzNzdweAt5eocJdfN7atrjOnvQ,109
22
- hyundai_kia_connect_api-3.40.4.dist-info/entry_points.txt,sha256=XfrroRdyC_9q9VXjEZe5SdRPhkQyCCE4S7ZK6XSKelA,67
23
- hyundai_kia_connect_api-3.40.4.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
24
- hyundai_kia_connect_api-3.40.4.dist-info/RECORD,,
18
+ hyundai_kia_connect_api-3.40.5.dist-info/licenses/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
19
+ hyundai_kia_connect_api-3.40.5.dist-info/licenses/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
20
+ hyundai_kia_connect_api-3.40.5.dist-info/METADATA,sha256=Hc5Adk8Qn4b1rBLooaxJCeLhtgbcNvZqScUISe0CX6M,7156
21
+ hyundai_kia_connect_api-3.40.5.dist-info/WHEEL,sha256=EJquVHAj64cglIJ9ayRTVz7VqL48CUivB2d_zEHhV7Q,109
22
+ hyundai_kia_connect_api-3.40.5.dist-info/entry_points.txt,sha256=XfrroRdyC_9q9VXjEZe5SdRPhkQyCCE4S7ZK6XSKelA,67
23
+ hyundai_kia_connect_api-3.40.5.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
24
+ hyundai_kia_connect_api-3.40.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.1.0)
2
+ Generator: setuptools (80.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any