hyundai-kia-connect-api 3.29.1__py2.py3-none-any.whl → 3.30.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.

Potentially problematic release.


This version of hyundai-kia-connect-api might be problematic. Click here for more details.

@@ -620,6 +620,59 @@ class KiaUvoApiUSA(ApiImpl):
620
620
 
621
621
  return response.headers["Xid"]
622
622
 
623
+ def _seat_settings(self, level) -> dict:
624
+ # See const.SEAT_STATUS for the list and descriptions of levels.
625
+ #
626
+ # The values were determined empirically, see https://github.com/Hyundai-Kia-Connect/kia_uvo/issues/718
627
+ if level == 8: # High heat
628
+ return {
629
+ "heatVentType": 1,
630
+ "heatVentLevel": 4,
631
+ "heatVentStep": 1,
632
+ }
633
+ elif level == 7: # Medium heat
634
+ return {
635
+ "heatVentType": 1,
636
+ "heatVentLevel": 3,
637
+ "heatVentStep": 2,
638
+ }
639
+ elif level == 6: # Low heat
640
+ return {
641
+ "heatVentType": 1,
642
+ "heatVentLevel": 2,
643
+ "heatVentStep": 3,
644
+ }
645
+ elif level == 5: # High cool
646
+ return {
647
+ "heatVentType": 2,
648
+ "heatVentLevel": 4,
649
+ "heatVentStep": 1,
650
+ }
651
+ elif level == 4: # Medium cool
652
+ return {
653
+ "heatVentType": 2,
654
+ "heatVentLevel": 3,
655
+ "heatVentStep": 2,
656
+ }
657
+ elif level == 3: # Low cool
658
+ return {
659
+ "heatVentType": 2,
660
+ "heatVentLevel": 2,
661
+ "heatVentStep": 3,
662
+ }
663
+ elif level == 1: # Generically on, let's assume high heat
664
+ return {
665
+ "heatVentType": 1,
666
+ "heatVentLevel": 4,
667
+ "heatVentStep": 1,
668
+ }
669
+ else: # Off
670
+ return {
671
+ "heatVentType": 0,
672
+ "heatVentLevel": 1,
673
+ "heatVentStep": 0,
674
+ }
675
+
623
676
  def start_climate(
624
677
  self, token: Token, vehicle: Vehicle, options: ClimateRequestOptions
625
678
  ) -> str:
@@ -668,72 +721,11 @@ class KiaUvoApiUSA(ApiImpl):
668
721
  or options.rear_left_seat is not None
669
722
  or options.rear_right_seat is not None
670
723
  ):
671
- if options.front_left_seat is None:
672
- options.front_left_seat = 0
673
- if options.front_right_seat is None:
674
- options.front_right_seat = 0
675
- if options.rear_left_seat is None:
676
- options.rear_left_seat = 0
677
- if options.rear_right_seat is None:
678
- options.rear_right_seat = 0
679
-
680
- front_left_heatVentType = 0
681
- front_right_heatVentType = 0
682
- rear_left_heatVentType = 0
683
- rear_right_heatVentType = 0
684
- front_left_heatVentLevel = 0
685
- front_right_heatVentLevel = 0
686
- rear_left_heatVentLevel = 0
687
- rear_right_heatVentLevel = 0
688
-
689
- # heated
690
- if options.front_left_seat in (6, 7, 8):
691
- front_left_heatVentType = 1
692
- front_left_heatVentLevel = options.front_left_seat - 4
693
- if options.front_right_seat in (6, 7, 8):
694
- front_right_heatVentType = 1
695
- front_right_heatVentLevel = options.front_right_seat - 4
696
- if options.rear_left_seat in (6, 7, 8):
697
- rear_left_heatVentType = 1
698
- rear_left_heatVentLevel = options.rear_left_seat - 4
699
- if options.rear_right_seat in (6, 7, 8):
700
- rear_right_heatVentType = 1
701
- rear_right_heatVentLevel = options.rear_right_seat - 4
702
-
703
- # ventilated
704
- if options.front_left_seat in (3, 4, 5):
705
- front_left_heatVentType = 2
706
- front_left_heatVentLevel = options.front_left_seat - 1
707
- if options.front_right_seat in (3, 4, 5):
708
- front_right_heatVentType = 2
709
- front_right_heatVentLevel = options.front_right_seat - 1
710
- if options.rear_left_seat in (3, 4, 5):
711
- rear_left_heatVentType = 2
712
- rear_left_heatVentLevel = options.rear_left_seat - 1
713
- if options.rear_right_seat in (3, 4, 5):
714
- rear_right_heatVentType = 2
715
- rear_right_heatVentLevel = options.rear_right_seat - 1
716
724
  body["remoteClimate"]["heatVentSeat"] = {
717
- "driverSeat": {
718
- "heatVentType": front_left_heatVentType,
719
- "heatVentLevel": front_left_heatVentLevel,
720
- "heatVentStep": 1,
721
- },
722
- "passengerSeat": {
723
- "heatVentType": front_right_heatVentType,
724
- "heatVentLevel": front_right_heatVentLevel,
725
- "heatVentStep": 1,
726
- },
727
- "rearLeftSeat": {
728
- "heatVentType": rear_left_heatVentType,
729
- "heatVentLevel": rear_left_heatVentLevel,
730
- "heatVentStep": 1,
731
- },
732
- "rearRightSeat": {
733
- "heatVentType": rear_right_heatVentType,
734
- "heatVentLevel": rear_right_heatVentLevel,
735
- "heatVentStep": 1,
736
- },
725
+ "driverSeat": self._seat_settings(options.front_left_seat),
726
+ "passengerSeat": self._seat_settings(options.front_right_seat),
727
+ "rearLeftSeat": self._seat_settings(options.rear_left_seat),
728
+ "rearRightSeat": self._seat_settings(options.rear_right_seat),
737
729
  }
738
730
  _LOGGER.debug(f"{DOMAIN} - Planned start_climate payload: {body}")
739
731
  response = self.post_request_with_logging_and_active_session(
@@ -97,23 +97,28 @@ class VehicleManager:
97
97
  _LOGGER.debug(f"{DOMAIN} - Vehicle Disabled, skipping.")
98
98
 
99
99
  def check_and_force_update_vehicles(self, force_refresh_interval: int) -> None:
100
+ for vehicle_id in self.vehicles.keys():
101
+ self.check_and_force_update_vehicle(force_refresh_interval, vehicle_id)
102
+
103
+ def check_and_force_update_vehicle(
104
+ self, force_refresh_interval: int, vehicle_id: str
105
+ ) -> None:
100
106
  # Force refresh only if current data is older than the value bassed in seconds.
101
107
  # Otherwise runs a cached update.
102
108
  started_at_utc: dt = dt.datetime.now(pytz.utc)
103
- for vehicle_id in self.vehicles.keys():
104
- vehicle = self.get_vehicle(vehicle_id)
105
- if vehicle.last_updated_at is not None:
106
- _LOGGER.debug(
107
- f"{DOMAIN} - Time differential in seconds: {(started_at_utc - vehicle.last_updated_at).total_seconds()}" # noqa
108
- )
109
- if (
110
- started_at_utc - vehicle.last_updated_at
111
- ).total_seconds() > force_refresh_interval:
112
- self.force_refresh_vehicle_state(vehicle_id)
113
- else:
114
- self.update_vehicle_with_cached_state(vehicle_id)
109
+ vehicle = self.get_vehicle(vehicle_id)
110
+ if vehicle.last_updated_at is not None:
111
+ _LOGGER.debug(
112
+ f"{DOMAIN} - Time differential in seconds: {(started_at_utc - vehicle.last_updated_at).total_seconds()}" # noqa
113
+ )
114
+ if (
115
+ started_at_utc - vehicle.last_updated_at
116
+ ).total_seconds() > force_refresh_interval:
117
+ self.force_refresh_vehicle_state(vehicle_id)
115
118
  else:
116
119
  self.update_vehicle_with_cached_state(vehicle_id)
120
+ else:
121
+ self.update_vehicle_with_cached_state(vehicle_id)
117
122
 
118
123
  def force_refresh_all_vehicles_states(self) -> None:
119
124
  for vehicle_id in self.vehicles.keys():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hyundai_kia_connect_api
3
- Version: 3.29.1
3
+ Version: 3.30.0
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
@@ -15,11 +15,11 @@ Classifier: Programming Language :: Python :: 3.10
15
15
  Requires-Python: >=3.10
16
16
  License-File: LICENSE
17
17
  License-File: AUTHORS.rst
18
- Requires-Dist: beautifulsoup4 >=4.10.0
19
- Requires-Dist: curlify >=2.2.1
18
+ Requires-Dist: beautifulsoup4>=4.10.0
19
+ Requires-Dist: curlify>=2.2.1
20
20
  Requires-Dist: python-dateutil
21
- Requires-Dist: pytz >=2021.3
22
- Requires-Dist: certifi >=2024.6.2
21
+ Requires-Dist: pytz>=2021.3
22
+ Requires-Dist: certifi>=2024.6.2
23
23
 
24
24
  Code Maintainers Wanted
25
25
  =======================
@@ -5,19 +5,19 @@ hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=tslh0gzvPBwYJmcWlf9B0l7PyYZdy2e7Gq
5
5
  hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=B3Lks_ONr3l01QLl-GQBPdktXj9PZWKuQKRLYmJ7kP4,30763
6
6
  hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=cwIPZ0dU6HolKdooUQeQKlLAic6YU8dQmNs0VQDBgpQ,47035
7
7
  hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=wNHMuyANzunMzp6DtjJmA1k4DbkXcHvebA-bS107ueA,70416
8
- hyundai_kia_connect_api/KiaUvoApiUSA.py,sha256=J7bDKgPqXnwMcG8aaw8gfwKs8XO-D0mTxC41vOpDlgw,31338
8
+ hyundai_kia_connect_api/KiaUvoApiUSA.py,sha256=fOXzWmVfRQj_kctJZZvpVb0W0voqo5hyG5E6eHddYjw,30386
9
9
  hyundai_kia_connect_api/Token.py,sha256=ZsPvXh1ID7FUTGHAqhZUZyrKT7xVbOtIn6FRJn4Ygf0,370
10
10
  hyundai_kia_connect_api/Vehicle.py,sha256=raCMzJsLuJnVHlFJ16VKdKat55L0uivbbcZRDCGWTxI,18793
11
- hyundai_kia_connect_api/VehicleManager.py,sha256=X_m8H9Jsg-P1x0QmD5wZOVLMppZ4I__ZMi7rOLSTRuE,10940
11
+ hyundai_kia_connect_api/VehicleManager.py,sha256=I0HDOsbXDen-26vyD7YR-RUgdaofOZrv_H_PPPuWjHg,11087
12
12
  hyundai_kia_connect_api/__init__.py,sha256=IkyVeIMbcFJZgLaiiNnUVA1Ferxvrm1bXHKVg01cxvc,319
13
13
  hyundai_kia_connect_api/bluelink.py,sha256=sBU7hlElie21GU4Ma-i4a5vdztGc2jtmlVBbbgUqmTE,19720
14
14
  hyundai_kia_connect_api/const.py,sha256=HE0_1_be4ERB73vsekWxv6TDWd8cvAgY1oPZojUrcwM,2096
15
15
  hyundai_kia_connect_api/exceptions.py,sha256=m7gyDnvA5OVAK4EXSP_ZwE0s0uV8HsGUV0tiYwqofK0,1343
16
16
  hyundai_kia_connect_api/utils.py,sha256=J0aXUX-nKIoS3XbelatNh-DZlHRU2_DYz_Mg_ZUKQJU,1957
17
- hyundai_kia_connect_api-3.29.1.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
18
- hyundai_kia_connect_api-3.29.1.dist-info/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
19
- hyundai_kia_connect_api-3.29.1.dist-info/METADATA,sha256=5ivYJSNh7jK42y37I5LzQSDdjL4Zhx2HG-Qc1DKXxDE,6678
20
- hyundai_kia_connect_api-3.29.1.dist-info/WHEEL,sha256=0VNUDWQJzfRahYI3neAhz2UVbRCtztpN5dPHAGvmGXc,109
21
- hyundai_kia_connect_api-3.29.1.dist-info/entry_points.txt,sha256=XfrroRdyC_9q9VXjEZe5SdRPhkQyCCE4S7ZK6XSKelA,67
22
- hyundai_kia_connect_api-3.29.1.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
23
- hyundai_kia_connect_api-3.29.1.dist-info/RECORD,,
17
+ hyundai_kia_connect_api-3.30.0.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
18
+ hyundai_kia_connect_api-3.30.0.dist-info/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
19
+ hyundai_kia_connect_api-3.30.0.dist-info/METADATA,sha256=1vb9sZTrsL_iKp7KhTdcaKLxgaPMN9we2jHZFAfVAcA,6674
20
+ hyundai_kia_connect_api-3.30.0.dist-info/WHEEL,sha256=pxeNX5JdtCe58PUSYP9upmc7jdRPgvT0Gm9kb1SHlVw,109
21
+ hyundai_kia_connect_api-3.30.0.dist-info/entry_points.txt,sha256=XfrroRdyC_9q9VXjEZe5SdRPhkQyCCE4S7ZK6XSKelA,67
22
+ hyundai_kia_connect_api-3.30.0.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
23
+ hyundai_kia_connect_api-3.30.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.5.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any