carconnectivity-connector-seatcupra 0.1a6__py3-none-any.whl → 0.1a7__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: carconnectivity-connector-seatcupra
3
- Version: 0.1a6
3
+ Version: 0.1a7
4
4
  Summary: CarConnectivity connector for Seat and Cupra services
5
5
  Author: Till Steinbach
6
6
  License: MIT License
@@ -1,10 +1,10 @@
1
1
  carconnectivity_connectors/seatcupra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- carconnectivity_connectors/seatcupra/_version.py,sha256=Hqe2m1dzf7-6SjKo8Gr6gXy8XAO0Guujh7xUPL78VzY,508
2
+ carconnectivity_connectors/seatcupra/_version.py,sha256=nPAOI_WMEKtOk02yUvEK3eWAK-N-z7v69X_Oo4clPLg,508
3
3
  carconnectivity_connectors/seatcupra/capability.py,sha256=Oe9tC_u69bj6VmOuNJ21RKoETe2j3QyZCoz-VgcZPQ0,4523
4
4
  carconnectivity_connectors/seatcupra/charging.py,sha256=BJe_5GEB0JkP78tpU6kyKpwuwjDZHvm-kt3PTlpQHeU,3336
5
5
  carconnectivity_connectors/seatcupra/climatization.py,sha256=0xxWlxrheAPzkVT8WRQtbm6ExZmVdgW7lUdOXyS_qWY,1695
6
6
  carconnectivity_connectors/seatcupra/command_impl.py,sha256=mtw8ZwJLmf79fPDZ1N3ImLfB8Gt9JPbzjMuIo2y5v3M,2879
7
- carconnectivity_connectors/seatcupra/connector.py,sha256=S6E7YlS8j39MPhV04ghOekevs53eEsZTlLyn7beeiMM,92982
7
+ carconnectivity_connectors/seatcupra/connector.py,sha256=abOaKWMikiSh4L2QpVd_JN-O__xq72qgTPtzXlzs3ZM,98787
8
8
  carconnectivity_connectors/seatcupra/vehicle.py,sha256=kiFVbJgq5VQOzf-vSli_2NsMgY0x4pwvJsjPWLGdr1g,3404
9
9
  carconnectivity_connectors/seatcupra/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  carconnectivity_connectors/seatcupra/auth/auth_util.py,sha256=Y81h8fGOMSMgPtE4wI_TI9WgE_s43uaPjRLBBINhj4g,4433
@@ -14,8 +14,8 @@ carconnectivity_connectors/seatcupra/auth/session_manager.py,sha256=NizIuY-pvkVB
14
14
  carconnectivity_connectors/seatcupra/auth/vw_web_session.py,sha256=hgsCdXugVnSgvLta4hBNtoNgMhAA83paAYO2fUOOFyM,10657
15
15
  carconnectivity_connectors/seatcupra/auth/helpers/blacklist_retry.py,sha256=f3wsiY5bpHDBxp7Va1Mv9nKJ4u3qnCHZZmDu78_AhMk,1251
16
16
  carconnectivity_connectors/seatcupra/ui/connector_ui.py,sha256=SNYnlcGJpbWhuLiIHD2l6H9IfSiMz3IgmvXsdossDnE,1412
17
- carconnectivity_connector_seatcupra-0.1a6.dist-info/LICENSE,sha256=PIwI1alwDyOfvEQHdGCm2u9uf_mGE8030xZDfun0xTo,1071
18
- carconnectivity_connector_seatcupra-0.1a6.dist-info/METADATA,sha256=gIbtmwE_VYMO2tDtu9jTTvXeNYAuBpyV3PUAdAt85W4,5386
19
- carconnectivity_connector_seatcupra-0.1a6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
20
- carconnectivity_connector_seatcupra-0.1a6.dist-info/top_level.txt,sha256=KqA8GviZsDH4PtmnwSQsz0HB_w-TWkeEHLIRNo5dTaI,27
21
- carconnectivity_connector_seatcupra-0.1a6.dist-info/RECORD,,
17
+ carconnectivity_connector_seatcupra-0.1a7.dist-info/LICENSE,sha256=PIwI1alwDyOfvEQHdGCm2u9uf_mGE8030xZDfun0xTo,1071
18
+ carconnectivity_connector_seatcupra-0.1a7.dist-info/METADATA,sha256=vi2_hRvDrTYazbHWLBreho7670Sh68cLhaEz9VCZ2b4,5386
19
+ carconnectivity_connector_seatcupra-0.1a7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
20
+ carconnectivity_connector_seatcupra-0.1a7.dist-info/top_level.txt,sha256=KqA8GviZsDH4PtmnwSQsz0HB_w-TWkeEHLIRNo5dTaI,27
21
+ carconnectivity_connector_seatcupra-0.1a7.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.1a6'
20
+ __version__ = version = '0.1a7'
21
21
  __version_tuple__ = version_tuple = (0, 1)
@@ -1089,27 +1089,37 @@ class Connector(BaseConnector):
1089
1089
  if 'command' not in command_arguments:
1090
1090
  raise CommandError('Command argument missing')
1091
1091
  command_dict: Dict = {}
1092
- if command_arguments['command'] == ChargingStartStopCommand.Command.START:
1093
- url = f'https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/{vin}/charging/requests/start'
1094
- if isinstance(vehicle, SeatCupraElectricVehicle) and vehicle.charging is not None and vehicle.charging.settings is not None \
1095
- and vehicle.charging.settings.maximum_current is not None and vehicle.charging.settings.maximum_current.enabled \
1096
- and vehicle.charging.settings.maximum_current.value is not None:
1097
- if vehicle.charging.settings.maximum_current.value <= 6:
1098
- command_dict['maxChargeCurrentAC'] = 'reduced'
1092
+ try:
1093
+ if command_arguments['command'] == ChargingStartStopCommand.Command.START:
1094
+ url = f'https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/{vin}/charging/requests/start'
1095
+ if isinstance(vehicle, SeatCupraElectricVehicle) and vehicle.charging is not None and vehicle.charging.settings is not None \
1096
+ and vehicle.charging.settings.maximum_current is not None and vehicle.charging.settings.maximum_current.enabled \
1097
+ and vehicle.charging.settings.maximum_current.value is not None:
1098
+ if vehicle.charging.settings.maximum_current.value <= 6:
1099
+ command_dict['maxChargeCurrentAC'] = 'reduced'
1100
+ else:
1101
+ command_dict['maxChargeCurrentAC'] = 'maximum'
1099
1102
  else:
1100
1103
  command_dict['maxChargeCurrentAC'] = 'maximum'
1104
+ command_response: requests.Response = self.session.post(url, json=command_dict, allow_redirects=True)
1105
+ elif command_arguments['command'] == ChargingStartStopCommand.Command.STOP:
1106
+ url = f'https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/{vin}/charging/requests/stop'
1107
+ command_response: requests.Response = self.session.post(url, data='{}', allow_redirects=True)
1101
1108
  else:
1102
- command_dict['maxChargeCurrentAC'] = 'maximum'
1103
- command_response: requests.Response = self.session.post(url, json=command_dict, allow_redirects=True)
1104
- elif command_arguments['command'] == ChargingStartStopCommand.Command.STOP:
1105
- url = f'https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/{vin}/charging/requests/stop'
1106
- command_response: requests.Response = self.session.post(url, data='{}', allow_redirects=True)
1107
- else:
1108
- raise CommandError(f'Unknown command {command_arguments["command"]}')
1109
-
1110
- if command_response.status_code not in [requests.codes['ok'], requests.codes['created']]:
1111
- LOG.error('Could not start/stop charging (%s: %s)', command_response.status_code, command_response.text)
1112
- raise CommandError(f'Could not start/stop charging ({command_response.status_code}: {command_response.text})')
1109
+ raise CommandError(f'Unknown command {command_arguments["command"]}')
1110
+
1111
+ if command_response.status_code not in [requests.codes['ok'], requests.codes['created']]:
1112
+ LOG.error('Could not start/stop charging (%s: %s)', command_response.status_code, command_response.text)
1113
+ raise CommandError(f'Could not start/stop charging ({command_response.status_code}: {command_response.text})')
1114
+ except requests.exceptions.ConnectionError as connection_error:
1115
+ raise CommandError(f'Connection error: {connection_error}.'
1116
+ ' If this happens frequently, please check if other applications communicate with the Skoda server.') from connection_error
1117
+ except requests.exceptions.ChunkedEncodingError as chunked_encoding_error:
1118
+ raise CommandError(f'Error: {chunked_encoding_error}') from chunked_encoding_error
1119
+ except requests.exceptions.ReadTimeout as timeout_error:
1120
+ raise CommandError(f'Timeout during read: {timeout_error}') from timeout_error
1121
+ except requests.exceptions.RetryError as retry_error:
1122
+ raise CommandError(f'Retrying failed: {retry_error}') from retry_error
1113
1123
  return command_arguments
1114
1124
 
1115
1125
  def __on_air_conditioning_start_stop(self, start_stop_command: ClimatizationStartStopCommand, command_arguments: Union[str, Dict[str, Any]]) \
@@ -1155,10 +1165,20 @@ class Connector(BaseConnector):
1155
1165
  url: str = f'https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/{vin}/climatisation/requests/stop'
1156
1166
  else:
1157
1167
  raise CommandError(f'Unknown command {command_arguments["command"]}')
1158
- command_response: requests.Response = self.session.post(url, data=json.dumps(command_dict), allow_redirects=True)
1159
- if command_response.status_code not in [requests.codes['ok'], requests.codes['created']]:
1160
- LOG.error('Could not start/stop air conditioning (%s: %s)', command_response.status_code, command_response.text)
1161
- raise CommandError(f'Could not start/stop air conditioning ({command_response.status_code}: {command_response.text})')
1168
+ try:
1169
+ command_response: requests.Response = self.session.post(url, data=json.dumps(command_dict), allow_redirects=True)
1170
+ if command_response.status_code not in [requests.codes['ok'], requests.codes['created']]:
1171
+ LOG.error('Could not start/stop air conditioning (%s: %s)', command_response.status_code, command_response.text)
1172
+ raise CommandError(f'Could not start/stop air conditioning ({command_response.status_code}: {command_response.text})')
1173
+ except requests.exceptions.ConnectionError as connection_error:
1174
+ raise CommandError(f'Connection error: {connection_error}.'
1175
+ ' If this happens frequently, please check if other applications communicate with the Skoda server.') from connection_error
1176
+ except requests.exceptions.ChunkedEncodingError as chunked_encoding_error:
1177
+ raise CommandError(f'Error: {chunked_encoding_error}') from chunked_encoding_error
1178
+ except requests.exceptions.ReadTimeout as timeout_error:
1179
+ raise CommandError(f'Timeout during read: {timeout_error}') from timeout_error
1180
+ except requests.exceptions.RetryError as retry_error:
1181
+ raise CommandError(f'Retrying failed: {retry_error}') from retry_error
1162
1182
  return command_arguments
1163
1183
 
1164
1184
  def __on_spin(self, spin_command: SpinCommand, command_arguments: Union[str, Dict[str, Any]]) \
@@ -1181,12 +1201,22 @@ class Connector(BaseConnector):
1181
1201
  url = f'https://ola.prod.code.seat.cloud.vwgroup.com/v2/users/{self.session.user_id}/spin/verify'
1182
1202
  else:
1183
1203
  raise CommandError(f'Unknown command {command_arguments["command"]}')
1184
- command_response: requests.Response = self.session.post(url, data=json.dumps(command_dict), allow_redirects=True)
1185
- if command_response.status_code != requests.codes['ok']:
1186
- LOG.error('Could not execute spin command (%s: %s)', command_response.status_code, command_response.text)
1187
- raise CommandError(f'Could not execute spin command ({command_response.status_code}: {command_response.text})')
1188
- else:
1189
- LOG.info('Spin verify command executed successfully')
1204
+ try:
1205
+ command_response: requests.Response = self.session.post(url, data=json.dumps(command_dict), allow_redirects=True)
1206
+ if command_response.status_code != requests.codes['ok']:
1207
+ LOG.error('Could not execute spin command (%s: %s)', command_response.status_code, command_response.text)
1208
+ raise CommandError(f'Could not execute spin command ({command_response.status_code}: {command_response.text})')
1209
+ else:
1210
+ LOG.info('Spin verify command executed successfully')
1211
+ except requests.exceptions.ConnectionError as connection_error:
1212
+ raise CommandError(f'Connection error: {connection_error}.'
1213
+ ' If this happens frequently, please check if other applications communicate with the Skoda server.') from connection_error
1214
+ except requests.exceptions.ChunkedEncodingError as chunked_encoding_error:
1215
+ raise CommandError(f'Error: {chunked_encoding_error}') from chunked_encoding_error
1216
+ except requests.exceptions.ReadTimeout as timeout_error:
1217
+ raise CommandError(f'Timeout during read: {timeout_error}') from timeout_error
1218
+ except requests.exceptions.RetryError as retry_error:
1219
+ raise CommandError(f'Retrying failed: {retry_error}') from retry_error
1190
1220
  return command_arguments
1191
1221
 
1192
1222
  def __on_wake_sleep(self, wake_sleep_command: WakeSleepCommand, command_arguments: Union[str, Dict[str, Any]]) \
@@ -1205,10 +1235,20 @@ class Connector(BaseConnector):
1205
1235
  if command_arguments['command'] == WakeSleepCommand.Command.WAKE:
1206
1236
  url = f'https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/{vin}/vehicle-wakeup/request'
1207
1237
 
1208
- command_response: requests.Response = self.session.post(url, data='{}', allow_redirects=True)
1209
- if command_response.status_code not in (requests.codes['ok'], requests.codes['no_content']):
1210
- LOG.error('Could not execute wake command (%s: %s)', command_response.status_code, command_response.text)
1211
- raise CommandError(f'Could not execute wake command ({command_response.status_code}: {command_response.text})')
1238
+ try:
1239
+ command_response: requests.Response = self.session.post(url, data='{}', allow_redirects=True)
1240
+ if command_response.status_code not in (requests.codes['ok'], requests.codes['no_content']):
1241
+ LOG.error('Could not execute wake command (%s: %s)', command_response.status_code, command_response.text)
1242
+ raise CommandError(f'Could not execute wake command ({command_response.status_code}: {command_response.text})')
1243
+ except requests.exceptions.ConnectionError as connection_error:
1244
+ raise CommandError(f'Connection error: {connection_error}.'
1245
+ ' If this happens frequently, please check if other applications communicate with the Skoda server.') from connection_error
1246
+ except requests.exceptions.ChunkedEncodingError as chunked_encoding_error:
1247
+ raise CommandError(f'Error: {chunked_encoding_error}') from chunked_encoding_error
1248
+ except requests.exceptions.ReadTimeout as timeout_error:
1249
+ raise CommandError(f'Timeout during read: {timeout_error}') from timeout_error
1250
+ except requests.exceptions.RetryError as retry_error:
1251
+ raise CommandError(f'Retrying failed: {retry_error}') from retry_error
1212
1252
  elif command_arguments['command'] == WakeSleepCommand.Command.SLEEP:
1213
1253
  raise CommandError('Sleep command not supported by vehicle. Vehicle will put itself to sleep')
1214
1254
  else:
@@ -1244,12 +1284,22 @@ class Connector(BaseConnector):
1244
1284
  command_dict['userPosition']['longitude'] = vehicle.position.longitude.value
1245
1285
 
1246
1286
  url = f'https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/{vin}/honk-and-flash'
1247
- command_response: requests.Response = self.session.post(url, data=json.dumps(command_dict), allow_redirects=True)
1248
- if command_response.status_code not in (requests.codes['ok'], requests.codes['no_content']):
1249
- LOG.error('Could not execute honk or flash command (%s: %s)', command_response.status_code, command_response.text)
1250
- raise CommandError(f'Could not execute honk or flash command ({command_response.status_code}: {command_response.text})')
1251
- else:
1252
- raise CommandError(f'Unknown command {command_arguments["command"]}')
1287
+ try:
1288
+ command_response: requests.Response = self.session.post(url, data=json.dumps(command_dict), allow_redirects=True)
1289
+ if command_response.status_code not in (requests.codes['ok'], requests.codes['no_content']):
1290
+ LOG.error('Could not execute honk or flash command (%s: %s)', command_response.status_code, command_response.text)
1291
+ raise CommandError(f'Could not execute honk or flash command ({command_response.status_code}: {command_response.text})')
1292
+ except requests.exceptions.ConnectionError as connection_error:
1293
+ raise CommandError(f'Connection error: {connection_error}.'
1294
+ ' If this happens frequently, please check if other applications communicate with the Skoda server.') from connection_error
1295
+ except requests.exceptions.ChunkedEncodingError as chunked_encoding_error:
1296
+ raise CommandError(f'Error: {chunked_encoding_error}') from chunked_encoding_error
1297
+ except requests.exceptions.ReadTimeout as timeout_error:
1298
+ raise CommandError(f'Timeout during read: {timeout_error}') from timeout_error
1299
+ except requests.exceptions.RetryError as retry_error:
1300
+ raise CommandError(f'Retrying failed: {retry_error}') from retry_error
1301
+ else:
1302
+ raise CommandError(f'Unknown command {command_arguments["command"]}')
1253
1303
  return command_arguments
1254
1304
 
1255
1305
  def __on_lock_unlock(self, lock_unlock_command: LockUnlockCommand, command_arguments: Union[str, Dict[str, Any]]) \
@@ -1278,10 +1328,20 @@ class Connector(BaseConnector):
1278
1328
  url = f'https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/{vin}/access/unlock'
1279
1329
  else:
1280
1330
  raise CommandError(f'Unknown command {command_arguments["command"]}')
1281
- command_response: requests.Response = self.session.post(url, data=json.dumps(command_dict), allow_redirects=True)
1282
- if command_response.status_code != requests.codes['ok']:
1283
- LOG.error('Could not execute locking command (%s: %s)', command_response.status_code, command_response.text)
1284
- raise CommandError(f'Could not execute locking command ({command_response.status_code}: {command_response.text})')
1331
+ try:
1332
+ command_response: requests.Response = self.session.post(url, data=json.dumps(command_dict), allow_redirects=True)
1333
+ if command_response.status_code != requests.codes['ok']:
1334
+ LOG.error('Could not execute locking command (%s: %s)', command_response.status_code, command_response.text)
1335
+ raise CommandError(f'Could not execute locking command ({command_response.status_code}: {command_response.text})')
1336
+ except requests.exceptions.ConnectionError as connection_error:
1337
+ raise CommandError(f'Connection error: {connection_error}.'
1338
+ ' If this happens frequently, please check if other applications communicate with the Skoda server.') from connection_error
1339
+ except requests.exceptions.ChunkedEncodingError as chunked_encoding_error:
1340
+ raise CommandError(f'Error: {chunked_encoding_error}') from chunked_encoding_error
1341
+ except requests.exceptions.ReadTimeout as timeout_error:
1342
+ raise CommandError(f'Timeout during read: {timeout_error}') from timeout_error
1343
+ except requests.exceptions.RetryError as retry_error:
1344
+ raise CommandError(f'Retrying failed: {retry_error}') from retry_error
1285
1345
  return command_arguments
1286
1346
 
1287
1347
  def __on_air_conditioning_settings_change(self, attribute: GenericAttribute, value: Any) -> Any:
@@ -1317,10 +1377,20 @@ class Connector(BaseConnector):
1317
1377
  setting_dict['climatisationWithoutExternalPower'] = settings.climatization_without_external_power.value
1318
1378
 
1319
1379
  url: str = f'https://ola.prod.code.seat.cloud.vwgroup.com/v2/vehicles/{vin}/climatisation/settings'
1320
- settings_response: requests.Response = self.session.post(url, data=json.dumps(setting_dict), allow_redirects=True)
1321
- if settings_response.status_code not in [requests.codes['ok'], requests.codes['created']]:
1322
- LOG.error('Could not set climatization settings (%s) %s', settings_response.status_code, settings_response.text)
1323
- raise SetterError(f'Could not set value ({settings_response.status_code}): {settings_response.text}')
1380
+ try:
1381
+ settings_response: requests.Response = self.session.post(url, data=json.dumps(setting_dict), allow_redirects=True)
1382
+ if settings_response.status_code not in [requests.codes['ok'], requests.codes['created']]:
1383
+ LOG.error('Could not set climatization settings (%s) %s', settings_response.status_code, settings_response.text)
1384
+ raise SetterError(f'Could not set value ({settings_response.status_code}): {settings_response.text}')
1385
+ except requests.exceptions.ConnectionError as connection_error:
1386
+ raise SetterError(f'Connection error: {connection_error}.'
1387
+ ' If this happens frequently, please check if other applications communicate with the Skoda server.') from connection_error
1388
+ except requests.exceptions.ChunkedEncodingError as chunked_encoding_error:
1389
+ raise SetterError(f'Error: {chunked_encoding_error}') from chunked_encoding_error
1390
+ except requests.exceptions.ReadTimeout as timeout_error:
1391
+ raise SetterError(f'Timeout during read: {timeout_error}') from timeout_error
1392
+ except requests.exceptions.RetryError as retry_error:
1393
+ raise SetterError(f'Retrying failed: {retry_error}') from retry_error
1324
1394
  return value
1325
1395
 
1326
1396
  def get_version(self) -> str: