carconnectivity-connector-skoda 0.6__py3-none-any.whl → 0.7.1a1__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.
- {carconnectivity_connector_skoda-0.6.dist-info → carconnectivity_connector_skoda-0.7.1a1.dist-info}/METADATA +3 -3
- {carconnectivity_connector_skoda-0.6.dist-info → carconnectivity_connector_skoda-0.7.1a1.dist-info}/RECORD +10 -10
- carconnectivity_connectors/skoda/_version.py +2 -2
- carconnectivity_connectors/skoda/auth/openid_session.py +2 -3
- carconnectivity_connectors/skoda/command_impl.py +1 -1
- carconnectivity_connectors/skoda/connector.py +17 -4
- carconnectivity_connectors/skoda/mqtt_client.py +1 -1
- {carconnectivity_connector_skoda-0.6.dist-info → carconnectivity_connector_skoda-0.7.1a1.dist-info}/WHEEL +0 -0
- {carconnectivity_connector_skoda-0.6.dist-info → carconnectivity_connector_skoda-0.7.1a1.dist-info}/licenses/LICENSE +0 -0
- {carconnectivity_connector_skoda-0.6.dist-info → carconnectivity_connector_skoda-0.7.1a1.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: carconnectivity-connector-skoda
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.1a1
|
|
4
4
|
Summary: CarConnectivity connector for Skoda services
|
|
5
5
|
Author: Till Steinbach
|
|
6
6
|
License: MIT License
|
|
@@ -37,10 +37,10 @@ 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.
|
|
40
|
+
Requires-Dist: carconnectivity>=0.7
|
|
41
41
|
Requires-Dist: oauthlib~=3.2.2
|
|
42
42
|
Requires-Dist: requests~=2.32.3
|
|
43
|
-
Requires-Dist:
|
|
43
|
+
Requires-Dist: pyjwt~=2.10
|
|
44
44
|
Requires-Dist: paho-mqtt~=2.1.0
|
|
45
45
|
Dynamic: license-file
|
|
46
46
|
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
carconnectivity_connector_skoda-0.
|
|
1
|
+
carconnectivity_connector_skoda-0.7.1a1.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=
|
|
3
|
+
carconnectivity_connectors/skoda/_version.py,sha256=pHY61gdymelMNQrdzvkKkynJJ2qr-0ukqQESii8vWCM,513
|
|
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=
|
|
8
|
-
carconnectivity_connectors/skoda/connector.py,sha256=
|
|
7
|
+
carconnectivity_connectors/skoda/command_impl.py,sha256=wDCI3Bka5pXlbyI4yVFS353TgFGyiBHBkERpP2g0A9w,3230
|
|
8
|
+
carconnectivity_connectors/skoda/connector.py,sha256=c-PavWSf1TNO5v773nmiP8vnxikRF6GdTl-hIO-_shA,146247
|
|
9
9
|
carconnectivity_connectors/skoda/error.py,sha256=ffxzvjmci7vtp9Q1K4DR1kBF0kTJxN5Gluci3kDBkEI,2459
|
|
10
|
-
carconnectivity_connectors/skoda/mqtt_client.py,sha256=
|
|
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
|
|
14
14
|
carconnectivity_connectors/skoda/auth/my_skoda_session.py,sha256=lSh23SFJs8opjmPwHTv-KNIKDep_WY4aItSP4Zq7bT8,10396
|
|
15
|
-
carconnectivity_connectors/skoda/auth/openid_session.py,sha256=
|
|
15
|
+
carconnectivity_connectors/skoda/auth/openid_session.py,sha256=dGj0FNBEz_NvYXvi5Wi0iYOzLWxPmNGtftb6ae3TVTE,16769
|
|
16
16
|
carconnectivity_connectors/skoda/auth/session_manager.py,sha256=Uf1vujuDBYUCAXhYToOsZkgbTtfmY3Qe0ICTfwomBpI,2899
|
|
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.
|
|
21
|
-
carconnectivity_connector_skoda-0.
|
|
22
|
-
carconnectivity_connector_skoda-0.
|
|
23
|
-
carconnectivity_connector_skoda-0.
|
|
20
|
+
carconnectivity_connector_skoda-0.7.1a1.dist-info/METADATA,sha256=9G4Dn8TUMCSRrH5F5XwqXexqcfjY2_C2NOc7eeya8xI,5383
|
|
21
|
+
carconnectivity_connector_skoda-0.7.1a1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
22
|
+
carconnectivity_connector_skoda-0.7.1a1.dist-info/top_level.txt,sha256=KqA8GviZsDH4PtmnwSQsz0HB_w-TWkeEHLIRNo5dTaI,27
|
|
23
|
+
carconnectivity_connector_skoda-0.7.1a1.dist-info/RECORD,,
|
|
@@ -7,7 +7,7 @@ import time
|
|
|
7
7
|
from datetime import datetime, timezone
|
|
8
8
|
import logging
|
|
9
9
|
import requests
|
|
10
|
-
|
|
10
|
+
import jwt
|
|
11
11
|
|
|
12
12
|
from oauthlib.common import UNICODE_ASCII_CHARACTER_SET, generate_nonce, generate_token
|
|
13
13
|
from oauthlib.oauth2.rfc6749.parameters import parse_authorization_code_response, parse_token_response, prepare_grant_uri
|
|
@@ -153,8 +153,7 @@ class OpenIDSession(requests.Session):
|
|
|
153
153
|
new_token['expires_in'] = self._token['expires_in']
|
|
154
154
|
else:
|
|
155
155
|
if 'id_token' in new_token:
|
|
156
|
-
|
|
157
|
-
meta_data = jwt_instance.decode(new_token['id_token'], do_verify=False)
|
|
156
|
+
meta_data = jwt.decode(new_token['id_token'], do_verify=False)
|
|
158
157
|
if 'exp' in meta_data:
|
|
159
158
|
new_token['expires_at'] = meta_data['exp']
|
|
160
159
|
expires_at = datetime.fromtimestamp(meta_data['exp'], tz=timezone.utc)
|
|
@@ -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
|
|
|
@@ -378,7 +378,8 @@ class Connector(BaseConnector):
|
|
|
378
378
|
if vehicle_to_update is not None and isinstance(vehicle_to_update, SkodaVehicle) and vehicle_to_update.is_managed_by_connector(self):
|
|
379
379
|
vehicle_to_update = self.fetch_vehicle_status(vehicle_to_update)
|
|
380
380
|
if vehicle_to_update.capabilities is not None and vehicle_to_update.capabilities.enabled:
|
|
381
|
-
if vehicle_to_update.capabilities.has_capability('MEASUREMENTS', check_status_ok=True)
|
|
381
|
+
if vehicle_to_update.capabilities.has_capability('MEASUREMENTS', check_status_ok=True) or \
|
|
382
|
+
vehicle_to_update.capabilities.has_capability('CHARGING', check_status_ok=True):
|
|
382
383
|
vehicle_to_update = self.fetch_driving_range(vehicle_to_update)
|
|
383
384
|
if vehicle_to_update.capabilities.has_capability('READINESS', check_status_ok=True):
|
|
384
385
|
vehicle_to_update = self.fetch_connection_status(vehicle_to_update)
|
|
@@ -404,13 +405,16 @@ class Connector(BaseConnector):
|
|
|
404
405
|
SkodaVehicle: The Skoda vehicle object with the updated state.
|
|
405
406
|
"""
|
|
406
407
|
if vehicle is not None:
|
|
407
|
-
if vehicle.
|
|
408
|
+
if vehicle.connection_state is not None and vehicle.connection_state.enabled \
|
|
409
|
+
and vehicle.connection_state.value == GenericVehicle.ConnectionState.OFFLINE:
|
|
410
|
+
vehicle.state._set_value(GenericVehicle.State.OFFLINE)
|
|
411
|
+
elif vehicle.in_motion is not None and vehicle.in_motion.enabled and vehicle.in_motion.value:
|
|
408
412
|
vehicle.state._set_value(GenericVehicle.State.IGNITION_ON) # pylint: disable=protected-access
|
|
409
413
|
elif vehicle.position is not None and vehicle.position.enabled and vehicle.position.position_type is not None \
|
|
410
414
|
and vehicle.position.position_type.enabled and vehicle.position.position_type.value == Position.PositionType.PARKING:
|
|
411
415
|
vehicle.state._set_value(GenericVehicle.State.PARKED) # pylint: disable=protected-access
|
|
412
416
|
else:
|
|
413
|
-
vehicle.state._set_value(
|
|
417
|
+
vehicle.state._set_value(GenericVehicle.State.UNKNOWN) # pylint: disable=protected-access
|
|
414
418
|
return vehicle
|
|
415
419
|
|
|
416
420
|
def fetch_charging(self, vehicle: SkodaElectricVehicle, no_cache: bool = False) -> SkodaElectricVehicle:
|
|
@@ -498,10 +502,12 @@ class Connector(BaseConnector):
|
|
|
498
502
|
cruising_range_in_km: float = data['status']['battery']['remainingCruisingRangeInMeters'] / 1000
|
|
499
503
|
# pylint: disable-next=protected-access
|
|
500
504
|
drive.range._set_value(value=cruising_range_in_km, measured=captured_at, unit=Length.KM)
|
|
505
|
+
drive.range.precision = 1
|
|
501
506
|
if 'stateOfChargeInPercent' in data['status']['battery'] \
|
|
502
507
|
and data['status']['battery']['stateOfChargeInPercent'] is not None:
|
|
503
508
|
# pylint: disable-next=protected-access
|
|
504
509
|
drive.level._set_value(value=data['status']['battery']['stateOfChargeInPercent'], measured=captured_at)
|
|
510
|
+
drive.level.precision = 1
|
|
505
511
|
log_extra_keys(LOG_API, 'status', data['status']['battery'], {'remainingCruisingRangeInMeters',
|
|
506
512
|
'stateOfChargeInPercent'})
|
|
507
513
|
break
|
|
@@ -703,7 +709,9 @@ class Connector(BaseConnector):
|
|
|
703
709
|
else:
|
|
704
710
|
longitude = None
|
|
705
711
|
vehicle.position.latitude._set_value(latitude) # pylint: disable=protected-access
|
|
712
|
+
vehicle.position.latitude.precision = 0.000001
|
|
706
713
|
vehicle.position.longitude._set_value(longitude) # pylint: disable=protected-access
|
|
714
|
+
vehicle.position.longitude.precision = 0.000001
|
|
707
715
|
vehicle.position.position_type._set_value(Position.PositionType.PARKING) # pylint: disable=protected-access
|
|
708
716
|
else:
|
|
709
717
|
vehicle.position.latitude._set_value(None) # pylint: disable=protected-access
|
|
@@ -756,6 +764,7 @@ class Connector(BaseConnector):
|
|
|
756
764
|
raise APIError('Could not fetch maintenance, capturedAt missing')
|
|
757
765
|
if 'mileageInKm' in data and data['mileageInKm'] is not None:
|
|
758
766
|
vehicle.odometer._set_value(value=data['mileageInKm'], measured=captured_at, unit=Length.KM) # pylint: disable=protected-access
|
|
767
|
+
vehicle.odometer.precision = 1
|
|
759
768
|
else:
|
|
760
769
|
vehicle.odometer._set_value(None) # pylint: disable=protected-access
|
|
761
770
|
if 'inspectionDueInDays' in data and data['inspectionDueInDays'] is not None:
|
|
@@ -1274,6 +1283,7 @@ class Connector(BaseConnector):
|
|
|
1274
1283
|
if 'totalRangeInKm' in range_data and range_data['totalRangeInKm'] is not None:
|
|
1275
1284
|
# pylint: disable-next=protected-access
|
|
1276
1285
|
vehicle.drives.total_range._set_value(value=range_data['totalRangeInKm'], measured=captured_at, unit=Length.KM)
|
|
1286
|
+
vehicle.drives.total_range.precision = 1
|
|
1277
1287
|
else:
|
|
1278
1288
|
vehicle.drives.total_range._set_value(None, measured=captured_at, unit=Length.KM) # pylint: disable=protected-access
|
|
1279
1289
|
|
|
@@ -1306,15 +1316,18 @@ class Connector(BaseConnector):
|
|
|
1306
1316
|
and range_data[f'{drive_id}EngineRange']['currentSoCInPercent'] is not None:
|
|
1307
1317
|
# pylint: disable-next=protected-access
|
|
1308
1318
|
drive.level._set_value(value=range_data[f'{drive_id}EngineRange']['currentSoCInPercent'], measured=captured_at)
|
|
1319
|
+
drive.level.precision = 1
|
|
1309
1320
|
elif 'currentFuelLevelInPercent' in range_data[f'{drive_id}EngineRange'] \
|
|
1310
1321
|
and range_data[f'{drive_id}EngineRange']['currentFuelLevelInPercent'] is not None:
|
|
1311
1322
|
# pylint: disable-next=protected-access
|
|
1312
1323
|
drive.level._set_value(value=range_data[f'{drive_id}EngineRange']['currentFuelLevelInPercent'], measured=captured_at)
|
|
1324
|
+
drive.level.precision = 1
|
|
1313
1325
|
else:
|
|
1314
1326
|
drive.level._set_value(None, measured=captured_at) # pylint: disable=protected-access
|
|
1315
1327
|
if 'remainingRangeInKm' in range_data[f'{drive_id}EngineRange'] and range_data[f'{drive_id}EngineRange']['remainingRangeInKm'] is not None:
|
|
1316
1328
|
# pylint: disable-next=protected-access
|
|
1317
1329
|
drive.range._set_value(value=range_data[f'{drive_id}EngineRange']['remainingRangeInKm'], measured=captured_at, unit=Length.KM)
|
|
1330
|
+
drive.range.precision = 1
|
|
1318
1331
|
else:
|
|
1319
1332
|
drive.range._set_value(None, measured=captured_at, unit=Length.KM) # pylint: disable=protected-access
|
|
1320
1333
|
|
|
@@ -1468,7 +1481,7 @@ class Connector(BaseConnector):
|
|
|
1468
1481
|
elif not allow_http_error or (allowed_errors is not None and status_response.status_code not in allowed_errors):
|
|
1469
1482
|
raise RetrievalError(f'Could not fetch data even after re-authorization. Status Code was: {status_response.status_code}')
|
|
1470
1483
|
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}')
|
|
1484
|
+
raise RetrievalError(f'Could not fetch data for {url}. Status Code was: {status_response.status_code}')
|
|
1472
1485
|
except requests.exceptions.ConnectionError as connection_error:
|
|
1473
1486
|
raise RetrievalError(f'Connection error: {connection_error}.'
|
|
1474
1487
|
' 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))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|