carconnectivity-connector-skoda 0.6__py3-none-any.whl → 0.7__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 carconnectivity-connector-skoda might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: carconnectivity-connector-skoda
3
- Version: 0.6
3
+ Version: 0.7
4
4
  Summary: CarConnectivity connector for Skoda services
5
5
  Author: Till Steinbach
6
6
  License: MIT License
@@ -37,7 +37,7 @@ Classifier: Topic :: Software Development :: Libraries
37
37
  Requires-Python: >=3.8
38
38
  Description-Content-Type: text/markdown
39
39
  License-File: LICENSE
40
- Requires-Dist: carconnectivity>=0.6
40
+ Requires-Dist: carconnectivity>=0.7
41
41
  Requires-Dist: oauthlib~=3.2.2
42
42
  Requires-Dist: requests~=2.32.3
43
43
  Requires-Dist: jwt~=1.3.1
@@ -1,13 +1,13 @@
1
- carconnectivity_connector_skoda-0.6.dist-info/licenses/LICENSE,sha256=PIwI1alwDyOfvEQHdGCm2u9uf_mGE8030xZDfun0xTo,1071
1
+ carconnectivity_connector_skoda-0.7.dist-info/licenses/LICENSE,sha256=PIwI1alwDyOfvEQHdGCm2u9uf_mGE8030xZDfun0xTo,1071
2
2
  carconnectivity_connectors/skoda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- carconnectivity_connectors/skoda/_version.py,sha256=G_QL3w-CuhuwBbKEJ8sRu9z-JXqi9Z6ikIDJgV_9mtw,506
3
+ carconnectivity_connectors/skoda/_version.py,sha256=pz35JP40uhhjvpunO5XmeQhmrllFsoC46JzXGE2quqw,506
4
4
  carconnectivity_connectors/skoda/capability.py,sha256=wH563-XUb_TnT8di1qDjnj-cY-cNHcAT6z7mx21LhSQ,4770
5
5
  carconnectivity_connectors/skoda/charging.py,sha256=7DPNiTWFhxiiEFKVnbIIU2TCmkpmcMWx_zsHXGXFpAQ,6856
6
6
  carconnectivity_connectors/skoda/climatization.py,sha256=Jut468SkxjPBDTqroWFvDifVPfJBxGjsFed5pc4kZkg,1768
7
- carconnectivity_connectors/skoda/command_impl.py,sha256=dWFoKR_G6j-p0wgqdeVbF3r68FO_jAmgzgPWxW9zvyY,3222
8
- carconnectivity_connectors/skoda/connector.py,sha256=Q1pUXD27XkoHF7mnYm86uSh8VF4OzurjJ55lJR9mY4I,145317
7
+ carconnectivity_connectors/skoda/command_impl.py,sha256=wDCI3Bka5pXlbyI4yVFS353TgFGyiBHBkERpP2g0A9w,3230
8
+ carconnectivity_connectors/skoda/connector.py,sha256=Lgg-_ySEgtvjGEFNTa5215ZJa8OYVEyGFolgPhV8mMA,146134
9
9
  carconnectivity_connectors/skoda/error.py,sha256=ffxzvjmci7vtp9Q1K4DR1kBF0kTJxN5Gluci3kDBkEI,2459
10
- carconnectivity_connectors/skoda/mqtt_client.py,sha256=RkZ43NG1Z_TUmc2hUZS0yYUfwewzfut63zZUhQR1xug,39101
10
+ carconnectivity_connectors/skoda/mqtt_client.py,sha256=D9_e_Bz842ULYKlRWd4JmosalhTtYr9DtCuvWrT3WQw,39126
11
11
  carconnectivity_connectors/skoda/vehicle.py,sha256=q5gwe-_yPfE_-aEc17UQ-Q0Z46IN7PCpNG5jLw5PZl0,3981
12
12
  carconnectivity_connectors/skoda/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  carconnectivity_connectors/skoda/auth/auth_util.py,sha256=dGLUbUre0HBsTg_Ii5vW34f8DLrCykYJYCyzEvUBBEE,4434
@@ -17,7 +17,7 @@ carconnectivity_connectors/skoda/auth/session_manager.py,sha256=Uf1vujuDBYUCAXhY
17
17
  carconnectivity_connectors/skoda/auth/skoda_web_session.py,sha256=tapjCRRPBu3tHrDoKmtuAlQhgxktib3oWTB8MHEzZTY,10816
18
18
  carconnectivity_connectors/skoda/auth/helpers/blacklist_retry.py,sha256=f3wsiY5bpHDBxp7Va1Mv9nKJ4u3qnCHZZmDu78_AhMk,1251
19
19
  carconnectivity_connectors/skoda/ui/connector_ui.py,sha256=lLjwoakRaU0S80hAVwVi4JA1wtHycGHcoM2-7S9qsqI,1386
20
- carconnectivity_connector_skoda-0.6.dist-info/METADATA,sha256=gBl4hXksq1yvNoa71CaDj2pu2VAujatHB5nxUM5kTnU,5378
21
- carconnectivity_connector_skoda-0.6.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
22
- carconnectivity_connector_skoda-0.6.dist-info/top_level.txt,sha256=KqA8GviZsDH4PtmnwSQsz0HB_w-TWkeEHLIRNo5dTaI,27
23
- carconnectivity_connector_skoda-0.6.dist-info/RECORD,,
20
+ carconnectivity_connector_skoda-0.7.dist-info/METADATA,sha256=l43xSHbtcW1miuJdp7el4wdFpyaGKc_vaggWQI5eNH4,5378
21
+ carconnectivity_connector_skoda-0.7.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
22
+ carconnectivity_connector_skoda-0.7.dist-info/top_level.txt,sha256=KqA8GviZsDH4PtmnwSQsz0HB_w-TWkeEHLIRNo5dTaI,27
23
+ carconnectivity_connector_skoda-0.7.dist-info/RECORD,,
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.6'
21
- __version_tuple__ = version_tuple = (0, 6)
20
+ __version__ = version = '0.7'
21
+ __version_tuple__ = version_tuple = (0, 7)
@@ -44,7 +44,7 @@ class SpinCommand(GenericCommand):
44
44
  parser.add_argument('--spin', dest='spin', help='Spin to be used instead of spin from config or .netrc', type=str, required=False,
45
45
  default=None)
46
46
  try:
47
- args = parser.parse_args(new_value.split(sep=' '))
47
+ args = parser.parse_args(new_value.strip().split(sep=' '))
48
48
  except argparse.ArgumentError as e:
49
49
  raise SetterError(f'Invalid format for SpinCommand: {e.message} {parser.format_usage()}') from e
50
50
 
@@ -404,13 +404,16 @@ class Connector(BaseConnector):
404
404
  SkodaVehicle: The Skoda vehicle object with the updated state.
405
405
  """
406
406
  if vehicle is not None:
407
- if vehicle.in_motion is not None and vehicle.in_motion.enabled and vehicle.in_motion.value:
407
+ if vehicle.connection_state is not None and vehicle.connection_state.enabled \
408
+ and vehicle.connection_state.value == GenericVehicle.ConnectionState.OFFLINE:
409
+ vehicle.state._set_value(GenericVehicle.State.OFFLINE)
410
+ elif vehicle.in_motion is not None and vehicle.in_motion.enabled and vehicle.in_motion.value:
408
411
  vehicle.state._set_value(GenericVehicle.State.IGNITION_ON) # pylint: disable=protected-access
409
412
  elif vehicle.position is not None and vehicle.position.enabled and vehicle.position.position_type is not None \
410
413
  and vehicle.position.position_type.enabled and vehicle.position.position_type.value == Position.PositionType.PARKING:
411
414
  vehicle.state._set_value(GenericVehicle.State.PARKED) # pylint: disable=protected-access
412
415
  else:
413
- vehicle.state._set_value(None) # pylint: disable=protected-access
416
+ vehicle.state._set_value(GenericVehicle.State.UNKNOWN) # pylint: disable=protected-access
414
417
  return vehicle
415
418
 
416
419
  def fetch_charging(self, vehicle: SkodaElectricVehicle, no_cache: bool = False) -> SkodaElectricVehicle:
@@ -498,10 +501,12 @@ class Connector(BaseConnector):
498
501
  cruising_range_in_km: float = data['status']['battery']['remainingCruisingRangeInMeters'] / 1000
499
502
  # pylint: disable-next=protected-access
500
503
  drive.range._set_value(value=cruising_range_in_km, measured=captured_at, unit=Length.KM)
504
+ drive.range.precision = 1
501
505
  if 'stateOfChargeInPercent' in data['status']['battery'] \
502
506
  and data['status']['battery']['stateOfChargeInPercent'] is not None:
503
507
  # pylint: disable-next=protected-access
504
508
  drive.level._set_value(value=data['status']['battery']['stateOfChargeInPercent'], measured=captured_at)
509
+ drive.level.precision = 1
505
510
  log_extra_keys(LOG_API, 'status', data['status']['battery'], {'remainingCruisingRangeInMeters',
506
511
  'stateOfChargeInPercent'})
507
512
  break
@@ -703,7 +708,9 @@ class Connector(BaseConnector):
703
708
  else:
704
709
  longitude = None
705
710
  vehicle.position.latitude._set_value(latitude) # pylint: disable=protected-access
711
+ vehicle.position.latitude.precision = 0.000001
706
712
  vehicle.position.longitude._set_value(longitude) # pylint: disable=protected-access
713
+ vehicle.position.longitude.precision = 0.000001
707
714
  vehicle.position.position_type._set_value(Position.PositionType.PARKING) # pylint: disable=protected-access
708
715
  else:
709
716
  vehicle.position.latitude._set_value(None) # pylint: disable=protected-access
@@ -756,6 +763,7 @@ class Connector(BaseConnector):
756
763
  raise APIError('Could not fetch maintenance, capturedAt missing')
757
764
  if 'mileageInKm' in data and data['mileageInKm'] is not None:
758
765
  vehicle.odometer._set_value(value=data['mileageInKm'], measured=captured_at, unit=Length.KM) # pylint: disable=protected-access
766
+ vehicle.odometer.precision = 1
759
767
  else:
760
768
  vehicle.odometer._set_value(None) # pylint: disable=protected-access
761
769
  if 'inspectionDueInDays' in data and data['inspectionDueInDays'] is not None:
@@ -1274,6 +1282,7 @@ class Connector(BaseConnector):
1274
1282
  if 'totalRangeInKm' in range_data and range_data['totalRangeInKm'] is not None:
1275
1283
  # pylint: disable-next=protected-access
1276
1284
  vehicle.drives.total_range._set_value(value=range_data['totalRangeInKm'], measured=captured_at, unit=Length.KM)
1285
+ vehicle.drives.total_range.precision = 1
1277
1286
  else:
1278
1287
  vehicle.drives.total_range._set_value(None, measured=captured_at, unit=Length.KM) # pylint: disable=protected-access
1279
1288
 
@@ -1306,15 +1315,18 @@ class Connector(BaseConnector):
1306
1315
  and range_data[f'{drive_id}EngineRange']['currentSoCInPercent'] is not None:
1307
1316
  # pylint: disable-next=protected-access
1308
1317
  drive.level._set_value(value=range_data[f'{drive_id}EngineRange']['currentSoCInPercent'], measured=captured_at)
1318
+ drive.level.precision = 1
1309
1319
  elif 'currentFuelLevelInPercent' in range_data[f'{drive_id}EngineRange'] \
1310
1320
  and range_data[f'{drive_id}EngineRange']['currentFuelLevelInPercent'] is not None:
1311
1321
  # pylint: disable-next=protected-access
1312
1322
  drive.level._set_value(value=range_data[f'{drive_id}EngineRange']['currentFuelLevelInPercent'], measured=captured_at)
1323
+ drive.level.precision = 1
1313
1324
  else:
1314
1325
  drive.level._set_value(None, measured=captured_at) # pylint: disable=protected-access
1315
1326
  if 'remainingRangeInKm' in range_data[f'{drive_id}EngineRange'] and range_data[f'{drive_id}EngineRange']['remainingRangeInKm'] is not None:
1316
1327
  # pylint: disable-next=protected-access
1317
1328
  drive.range._set_value(value=range_data[f'{drive_id}EngineRange']['remainingRangeInKm'], measured=captured_at, unit=Length.KM)
1329
+ drive.range.precision = 1
1318
1330
  else:
1319
1331
  drive.range._set_value(None, measured=captured_at, unit=Length.KM) # pylint: disable=protected-access
1320
1332
 
@@ -1468,7 +1480,7 @@ class Connector(BaseConnector):
1468
1480
  elif not allow_http_error or (allowed_errors is not None and status_response.status_code not in allowed_errors):
1469
1481
  raise RetrievalError(f'Could not fetch data even after re-authorization. Status Code was: {status_response.status_code}')
1470
1482
  elif not allow_http_error or (allowed_errors is not None and status_response.status_code not in allowed_errors):
1471
- raise RetrievalError(f'Could not fetch data. Status Code was: {status_response.status_code}')
1483
+ raise RetrievalError(f'Could not fetch data for {url}. Status Code was: {status_response.status_code}')
1472
1484
  except requests.exceptions.ConnectionError as connection_error:
1473
1485
  raise RetrievalError(f'Connection error: {connection_error}.'
1474
1486
  ' If this happens frequently, please check if other applications communicate with the Skoda server.') from connection_error
@@ -480,7 +480,7 @@ class SkodaMQTTClient(Client): # pylint: disable=too-many-instance-attributes
480
480
  old_charging_state: Optional[Charging.ChargingState] = charging_state
481
481
  if 'mode' in data['data'] and data['data']['mode'] is not None \
482
482
  and vehicle.charging is not None and isinstance(vehicle.charging.settings, SkodaCharging.Settings):
483
- if data['data']['mode'] in SkodaCharging.SkodaChargeMode:
483
+ if data['data']['mode'] in [item.value for item in SkodaCharging.SkodaChargeMode]:
484
484
  skoda_charging_mode = SkodaCharging.SkodaChargeMode(data['data']['mode'])
485
485
  else:
486
486
  LOG_API.info('Unkown charging mode %s not in %s', data['data']['mode'], str(SkodaCharging.SkodaChargeMode))