hyundai-kia-connect-api 3.23.3__py2.py3-none-any.whl → 3.23.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.
@@ -48,18 +48,9 @@ class ApiImplType1(ApiImpl):
48
48
 
49
49
  def _update_vehicle_properties_ccs2(self, vehicle: Vehicle, state: dict) -> None:
50
50
  if get_child_value(state, "Date"):
51
- # `Date` field is in UTC time
52
- if vehicle.last_updated_at:
53
- vehicle.last_updated_at = parse_datetime(
54
- get_child_value(state, "Date"), dt.timezone.utc
55
- )
56
- elif vehicle.last_updated_at < parse_datetime(
57
- get_child_value(state, "Date"), dt.timezone.utc
58
- ):
59
- vehicle.last_updated_at = parse_datetime(
60
- get_child_value(state, "Date"), dt.timezone.utc
61
- )
62
-
51
+ vehicle.last_updated_at = parse_datetime(
52
+ get_child_value(state, "Date"), self.data_timezone
53
+ )
63
54
  else:
64
55
  vehicle.last_updated_at = dt.datetime.now(self.data_timezone)
65
56
 
@@ -356,7 +356,19 @@ class Vehicle:
356
356
 
357
357
  @last_updated_at.setter
358
358
  def last_updated_at(self, value):
359
- self._last_updated_at = get_safe_local_datetime(value)
359
+ # workaround for: Timestamp of "last_updated_at" sensor is wrong #931
360
+ # https://github.com/Hyundai-Kia-Connect/kia_uvo/issues/931#issuecomment-2381569934
361
+ newest_updated_at = get_safe_local_datetime(value)
362
+ previous_updated_at = self._last_updated_at
363
+ if newest_updated_at and previous_updated_at: # both filled
364
+ if newest_updated_at < previous_updated_at:
365
+ utcoffset = newest_updated_at.utcoffset()
366
+ newest_updated_at_corrected = newest_updated_at + utcoffset
367
+ if newest_updated_at_corrected >= previous_updated_at:
368
+ newest_updated_at = newest_updated_at_corrected
369
+ if newest_updated_at < previous_updated_at:
370
+ newest_updated_at = previous_updated_at # keep old because newer
371
+ self._last_updated_at = newest_updated_at
360
372
 
361
373
  @property
362
374
  def location_latitude(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hyundai_kia_connect_api
3
- Version: 3.23.3
3
+ Version: 3.23.5
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
@@ -1,5 +1,5 @@
1
1
  hyundai_kia_connect_api/ApiImpl.py,sha256=7tB6PZTEVlw-GCfEjU4ekq_ZgnFseYLrEYpbUyEoL84,6866
2
- hyundai_kia_connect_api/ApiImplType1.py,sha256=w7K_M9WARpba3XSI0eauNJ0szEflAt-fg_RMViVDu08,12558
2
+ hyundai_kia_connect_api/ApiImplType1.py,sha256=PnKwpbCoYGOXBWzBLIlDSrC6daIYeW9qlfW7TM4HCU0,12184
3
3
  hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py,sha256=xHUpj-1bzHQL4w82kRAt9FMB8ze_DoqZinK6djCyeKY,35619
4
4
  hyundai_kia_connect_api/KiaUvoAPIUSA.py,sha256=Cvkjat13g4AmETUxjpLkwCnB9i0Unck2jKExOCsPjcw,31146
5
5
  hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=Mzw0Ov5la4mQvWOXWYpvAfrM6l2BSBEusaPFsL3kn2I,48127
@@ -7,15 +7,15 @@ hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=6bBPav3GC4xEl5y-4A6RHThtf7R0jeb2ys
7
7
  hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=cwIPZ0dU6HolKdooUQeQKlLAic6YU8dQmNs0VQDBgpQ,47035
8
8
  hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=eijKZFBOl2cSsbELzUCpSVfIxdSwNC5EtMHDErvZczY,68253
9
9
  hyundai_kia_connect_api/Token.py,sha256=ZsPvXh1ID7FUTGHAqhZUZyrKT7xVbOtIn6FRJn4Ygf0,370
10
- hyundai_kia_connect_api/Vehicle.py,sha256=CKQbyKwCbx7-xN3SYMsi9JCz4P9jHeNlo37BEC3xu1g,17821
10
+ hyundai_kia_connect_api/Vehicle.py,sha256=27qkcKtSZEpo3SfYsuYU0R5tPkZLrg7ERAKNj4gD_0o,18633
11
11
  hyundai_kia_connect_api/VehicleManager.py,sha256=REny83eNXERAcnw8qrBZ9dh6qODCvd5Z_jmSY2JtXvY,10196
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
15
  hyundai_kia_connect_api/utils.py,sha256=J0aXUX-nKIoS3XbelatNh-DZlHRU2_DYz_Mg_ZUKQJU,1957
16
- hyundai_kia_connect_api-3.23.3.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
17
- hyundai_kia_connect_api-3.23.3.dist-info/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
18
- hyundai_kia_connect_api-3.23.3.dist-info/METADATA,sha256=0_NF-WHuAQWbVaZIcdkkAxk1MB-TMQRyj_eOlVFZOGk,6069
19
- hyundai_kia_connect_api-3.23.3.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
20
- hyundai_kia_connect_api-3.23.3.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
21
- hyundai_kia_connect_api-3.23.3.dist-info/RECORD,,
16
+ hyundai_kia_connect_api-3.23.5.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
17
+ hyundai_kia_connect_api-3.23.5.dist-info/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
18
+ hyundai_kia_connect_api-3.23.5.dist-info/METADATA,sha256=2kIibKD0_TUzCY5Cs5zNmpmfRabWQ0nQr1M77pXgeUY,6069
19
+ hyundai_kia_connect_api-3.23.5.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
20
+ hyundai_kia_connect_api-3.23.5.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
21
+ hyundai_kia_connect_api-3.23.5.dist-info/RECORD,,