carconnectivity-connector-skoda 0.7.3__py3-none-any.whl → 0.8.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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: carconnectivity-connector-skoda
3
- Version: 0.7.3
3
+ Version: 0.8.1a1
4
4
  Summary: CarConnectivity connector for Skoda services
5
5
  Author: Till Steinbach
6
6
  License: MIT License
@@ -1,23 +1,23 @@
1
- carconnectivity_connector_skoda-0.7.3.dist-info/licenses/LICENSE,sha256=PIwI1alwDyOfvEQHdGCm2u9uf_mGE8030xZDfun0xTo,1071
1
+ carconnectivity_connector_skoda-0.8.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=HuvheJ09dqzSRYh_uHb_Af7PEi7XiVW5Tk0cjtnAa6I,511
4
- carconnectivity_connectors/skoda/capability.py,sha256=wH563-XUb_TnT8di1qDjnj-cY-cNHcAT6z7mx21LhSQ,4770
3
+ carconnectivity_connectors/skoda/_version.py,sha256=EnyZ6UT9V1Ty-kXYVwQOtic6_yoBT3hqMFktE52aRgs,712
4
+ carconnectivity_connectors/skoda/capability.py,sha256=TC8-yC23UUrf0faePdbZL0802DHXbtGDcSlt3vj5ltg,4770
5
5
  carconnectivity_connectors/skoda/charging.py,sha256=7DPNiTWFhxiiEFKVnbIIU2TCmkpmcMWx_zsHXGXFpAQ,6856
6
6
  carconnectivity_connectors/skoda/climatization.py,sha256=Jut468SkxjPBDTqroWFvDifVPfJBxGjsFed5pc4kZkg,1768
7
7
  carconnectivity_connectors/skoda/command_impl.py,sha256=wDCI3Bka5pXlbyI4yVFS353TgFGyiBHBkERpP2g0A9w,3230
8
- carconnectivity_connectors/skoda/connector.py,sha256=c-PavWSf1TNO5v773nmiP8vnxikRF6GdTl-hIO-_shA,146247
8
+ carconnectivity_connectors/skoda/connector.py,sha256=y25ZY1jCH-8IXSK847Stu4GbRK6j35xwZJKU9C7TSSU,147301
9
9
  carconnectivity_connectors/skoda/error.py,sha256=ffxzvjmci7vtp9Q1K4DR1kBF0kTJxN5Gluci3kDBkEI,2459
10
- carconnectivity_connectors/skoda/mqtt_client.py,sha256=D9_e_Bz842ULYKlRWd4JmosalhTtYr9DtCuvWrT3WQw,39126
10
+ carconnectivity_connectors/skoda/mqtt_client.py,sha256=QQv_XcvgMWn541_jiwl1Q6_iIm1cscZtVQjs0_qHFiw,39466
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=jlRBN6A1Z-U_YrgdD-X1itRG-aelnMGPQe_dg_XOmCs,16789
15
+ carconnectivity_connectors/skoda/auth/openid_session.py,sha256=SFDnKbPZ8qkABlguRNO_pLki4G6tM3Be4nwhFnt8SPw,17062
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.7.3.dist-info/METADATA,sha256=NJ-AVssOQtHcSlCA_OxjEYHaHLsEYdAFEa6lrwg_RvM,5383
21
- carconnectivity_connector_skoda-0.7.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
- carconnectivity_connector_skoda-0.7.3.dist-info/top_level.txt,sha256=KqA8GviZsDH4PtmnwSQsz0HB_w-TWkeEHLIRNo5dTaI,27
23
- carconnectivity_connector_skoda-0.7.3.dist-info/RECORD,,
20
+ carconnectivity_connector_skoda-0.8.1a1.dist-info/METADATA,sha256=cjtjHqb_74tcL-p8AjA0AWnmUuiEoYm6T3md2n-Dg0k,5385
21
+ carconnectivity_connector_skoda-0.8.1a1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ carconnectivity_connector_skoda-0.8.1a1.dist-info/top_level.txt,sha256=KqA8GviZsDH4PtmnwSQsz0HB_w-TWkeEHLIRNo5dTaI,27
23
+ carconnectivity_connector_skoda-0.8.1a1.dist-info/RECORD,,
@@ -1,7 +1,14 @@
1
1
  # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
3
 
4
- __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
5
12
 
6
13
  TYPE_CHECKING = False
7
14
  if TYPE_CHECKING:
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
9
16
  from typing import Union
10
17
 
11
18
  VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
12
20
  else:
13
21
  VERSION_TUPLE = object
22
+ COMMIT_ID = object
14
23
 
15
24
  version: str
16
25
  __version__: str
17
26
  __version_tuple__: VERSION_TUPLE
18
27
  version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
19
30
 
20
- __version__ = version = '0.7.3'
21
- __version_tuple__ = version_tuple = (0, 7, 3)
31
+ __version__ = version = '0.8.1a1'
32
+ __version_tuple__ = version_tuple = (0, 8, 1, 'a1')
33
+
34
+ __commit_id__ = commit_id = None
@@ -1,4 +1,4 @@
1
- """Implements a session class that handles OpenID authentication."""
1
+ """Implements a session class that handles OpenID authentication."""
2
2
  from __future__ import annotations
3
3
  from typing import TYPE_CHECKING
4
4
 
@@ -165,6 +165,10 @@ class OpenIDSession(requests.Session):
165
165
  # If expires_in is set and expires_at is not set we calculate expires_at from expires_in using the current time
166
166
  if 'expires_in' in new_token and 'expires_at' not in new_token:
167
167
  new_token['expires_at'] = time.time() + int(new_token.get('expires_in'))
168
+ if new_token['expires_in'] > 3600:
169
+ LOG.warning('unexpected Token expires_in > 3600s (%d)', new_token['expires_in'])
170
+ if new_token['expires_at'] > (time.time() + 3600):
171
+ LOG.warning('unexpected Token expires_at after more than 3600s')
168
172
  self._token = new_token
169
173
 
170
174
  @property
@@ -132,7 +132,7 @@ class Capability(GenericObject):
132
132
  LOCATION_DATA_DISABLED = 1013
133
133
  LICENSE_INACTIVE = 2001
134
134
  LICENSE_EXPIRED = 2002
135
- MISSING_LICENSE = 2003
135
+ LICENSE_MISSING = 2003
136
136
  USER_NOT_VERIFIED = 3001
137
137
  TERMS_AND_CONDITIONS_NOT_ACCEPTED = 3002
138
138
  INSUFFICIENT_RIGHTS = 3003
@@ -22,7 +22,7 @@ from carconnectivity.units import Length, Speed, Power, Temperature
22
22
  from carconnectivity.doors import Doors
23
23
  from carconnectivity.windows import Windows
24
24
  from carconnectivity.lights import Lights
25
- from carconnectivity.drive import GenericDrive, ElectricDrive, CombustionDrive
25
+ from carconnectivity.drive import GenericDrive, ElectricDrive, CombustionDrive, DieselDrive
26
26
  from carconnectivity.attributes import BooleanAttribute, DurationAttribute, TemperatureAttribute, EnumAttribute, LevelAttribute, \
27
27
  CurrentAttribute
28
28
  from carconnectivity.charging import Charging
@@ -407,7 +407,7 @@ class Connector(BaseConnector):
407
407
  if vehicle is not None:
408
408
  if vehicle.connection_state is not None and vehicle.connection_state.enabled \
409
409
  and vehicle.connection_state.value == GenericVehicle.ConnectionState.OFFLINE:
410
- vehicle.state._set_value(GenericVehicle.State.OFFLINE)
410
+ vehicle.state._set_value(GenericVehicle.State.OFFLINE) # pylint: disable=protected-access
411
411
  elif vehicle.in_motion is not None and vehicle.in_motion.enabled and vehicle.in_motion.value:
412
412
  vehicle.state._set_value(GenericVehicle.State.IGNITION_ON) # pylint: disable=protected-access
413
413
  elif vehicle.position is not None and vehicle.position.enabled and vehicle.position.position_type is not None \
@@ -1301,10 +1301,11 @@ class Connector(BaseConnector):
1301
1301
  else:
1302
1302
  if engine_type == GenericDrive.Type.ELECTRIC:
1303
1303
  drive = ElectricDrive(drive_id=drive_id, drives=vehicle.drives)
1304
+ elif engine_type == GenericDrive.Type.DIESEL:
1305
+ drive = DieselDrive(drive_id=drive_id, drives=vehicle.drives)
1304
1306
  elif engine_type in [GenericDrive.Type.FUEL,
1305
1307
  GenericDrive.Type.GASOLINE,
1306
1308
  GenericDrive.Type.PETROL,
1307
- GenericDrive.Type.DIESEL,
1308
1309
  GenericDrive.Type.CNG,
1309
1310
  GenericDrive.Type.LPG]:
1310
1311
  drive = CombustionDrive(drive_id=drive_id, drives=vehicle.drives)
@@ -1335,9 +1336,22 @@ class Connector(BaseConnector):
1335
1336
  'currentSoCInPercent',
1336
1337
  'currentFuelLevelInPercent',
1337
1338
  'remainingRangeInKm'})
1339
+ if 'adBlueRange' in range_data and range_data['adBlueRange'] is not None:
1340
+ # pylint: disable-next=protected-access
1341
+ for drive in vehicle.drives.drives.values():
1342
+ if isinstance(drive, DieselDrive):
1343
+ # pylint: disable-next=protected-access
1344
+ drive.adblue_range._set_value(value=range_data['adBlueRange'], measured=captured_at, unit=Length.KM)
1345
+ drive.adblue_range.precision = 1
1346
+ else:
1347
+ for drive in vehicle.drives.drives.values():
1348
+ if isinstance(drive, DieselDrive):
1349
+ # pylint: disable-next=protected-access
1350
+ drive.adblue_range._set_value(value=None, measured=captured_at, unit=Length.KM)
1338
1351
  log_extra_keys(LOG_API, '/api/v2/vehicle-status/{vin}/driving-range', range_data, {'carCapturedTimestamp',
1339
1352
  'carType',
1340
1353
  'totalRangeInKm',
1354
+ 'adBlueRange',
1341
1355
  'primaryEngineRange',
1342
1356
  'secondaryEngineRange'})
1343
1357
  return vehicle
@@ -70,6 +70,8 @@ class SkodaMQTTClient(Client): # pylint: disable=too-many-instance-attributes
70
70
  self.delayed_access_function_timers: Dict[str, threading.Timer] = {}
71
71
 
72
72
  self.tls_set(cert_reqs=ssl.CERT_NONE)
73
+
74
+ self._retry_refresh_login_once = True
73
75
 
74
76
  def connect(self, *args, **kwargs) -> MQTTErrorCode:
75
77
  """
@@ -321,6 +323,7 @@ class SkodaMQTTClient(Client): # pylint: disable=too-many-instance-attributes
321
323
  self._skoda_connector.car_connectivity.garage.add_observer(observer=self._on_carconnectivity_vehicle_enabled,
322
324
  flag=observer_flags,
323
325
  priority=Observable.ObserverPriority.USER_MID)
326
+ self._retry_refresh_login_once = True
324
327
  self._subscribe_vehicles()
325
328
 
326
329
  # Handle different reason codes
@@ -338,6 +341,10 @@ class SkodaMQTTClient(Client): # pylint: disable=too-many-instance-attributes
338
341
  LOG.error('Could not connect (%s): Client identifier not valid', reason_code)
339
342
  elif reason_code == 134:
340
343
  LOG.error('Could not connect (%s): Bad user name or password', reason_code)
344
+ if self._retry_refresh_login_once == True:
345
+ self._retry_refresh_login_once = False
346
+ LOG.info('trying a relogin once to resolve the error')
347
+ self._skoda_connector.session.login()
341
348
  elif reason_code == 135:
342
349
  LOG.error('Could not connect (%s): Not authorized', reason_code)
343
350
  elif reason_code == 136: