carconnectivity-connector-seatcupra 0.1a5__tar.gz → 0.1a7__tar.gz
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.
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/PKG-INFO +2 -2
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/pyproject.toml +1 -1
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connector_seatcupra.egg-info/PKG-INFO +2 -2
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connector_seatcupra.egg-info/requires.txt +1 -1
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/_version.py +1 -1
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/connector.py +155 -47
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/.flake8 +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/.github/dependabot.yml +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/.github/workflows/build.yml +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/.github/workflows/build_and_publish.yml +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/.github/workflows/codeql-analysis.yml +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/.gitignore +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/CHANGELOG.md +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/LICENSE +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/Makefile +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/README.md +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/doc/Config.md +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/setup.cfg +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/setup_requirements.txt +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connector_seatcupra.egg-info/SOURCES.txt +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connector_seatcupra.egg-info/dependency_links.txt +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connector_seatcupra.egg-info/top_level.txt +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/__init__.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/auth/__init__.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/auth/auth_util.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/auth/helpers/blacklist_retry.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/auth/my_cupra_session.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/auth/openid_session.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/auth/session_manager.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/auth/vw_web_session.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/capability.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/charging.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/climatization.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/command_impl.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/ui/connector_ui.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/src/carconnectivity_connectors/seatcupra/vehicle.py +0 -0
- {carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/test/integration_test/carConnectivity.json +0 -0
{carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: carconnectivity-connector-seatcupra
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.1a7
|
4
4
|
Summary: CarConnectivity connector for Seat and Cupra 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.9
|
38
38
|
Description-Content-Type: text/markdown
|
39
39
|
License-File: LICENSE
|
40
|
-
Requires-Dist: carconnectivity>=0.
|
40
|
+
Requires-Dist: carconnectivity>=0.4a4
|
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,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: carconnectivity-connector-seatcupra
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.1a7
|
4
4
|
Summary: CarConnectivity connector for Seat and Cupra 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.9
|
38
38
|
Description-Content-Type: text/markdown
|
39
39
|
License-File: LICENSE
|
40
|
-
Requires-Dist: carconnectivity>=0.
|
40
|
+
Requires-Dist: carconnectivity>=0.4a4
|
41
41
|
Requires-Dist: oauthlib~=3.2.2
|
42
42
|
Requires-Dist: requests~=2.32.3
|
43
43
|
Requires-Dist: jwt~=1.3.1
|
@@ -259,6 +259,8 @@ class Connector(BaseConnector):
|
|
259
259
|
vehicle_to_update = self.fetch_charging(vehicle_to_update)
|
260
260
|
if vehicle_to_update.capabilities.has_capability('parkingPosition'):
|
261
261
|
vehicle_to_update = self.fetch_parking_position(vehicle_to_update)
|
262
|
+
if vehicle_to_update.capabilities.has_capability('vehicleHealthInspection'):
|
263
|
+
vehicle_to_update = self.fetch_maintenance(vehicle_to_update)
|
262
264
|
|
263
265
|
def fetch_vehicles(self) -> None:
|
264
266
|
"""
|
@@ -737,6 +739,42 @@ class Connector(BaseConnector):
|
|
737
739
|
vehicle.odometer._set_value(None) # pylint: disable=protected-access
|
738
740
|
return vehicle
|
739
741
|
|
742
|
+
def fetch_maintenance(self, vehicle: SeatCupraVehicle, no_cache: bool = False) -> SeatCupraVehicle:
|
743
|
+
vin = vehicle.vin.value
|
744
|
+
if vin is None:
|
745
|
+
raise APIError('VIN is missing')
|
746
|
+
url = f'https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/{vin}/maintenance'
|
747
|
+
data: Dict[str, Any] | None = self._fetch_data(url=url, session=self.session, no_cache=no_cache)
|
748
|
+
if data is not None:
|
749
|
+
if 'inspectionDueDays' in data and data['inspectionDueDays'] is not None:
|
750
|
+
inspection_due: timedelta = timedelta(days=data['inspectionDueDays'])
|
751
|
+
inspection_date: datetime = datetime.now(tz=timezone.utc) + inspection_due
|
752
|
+
inspection_date = inspection_date.replace(hour=0, minute=0, second=0, microsecond=0)
|
753
|
+
# pylint: disable-next=protected-access
|
754
|
+
vehicle.maintenance.inspection_due_at._set_value(value=inspection_date)
|
755
|
+
else:
|
756
|
+
vehicle.maintenance.inspection_due_at._set_value(None) # pylint: disable=protected-access
|
757
|
+
if 'inspectionDueKm' in data and data['inspectionDueKm'] is not None:
|
758
|
+
vehicle.maintenance.inspection_due_after._set_value(data['inspectionDueKm'], unit=Length.KM) # pylint: disable=protected-access
|
759
|
+
else:
|
760
|
+
vehicle.maintenance.inspection_due_after._set_value(None) # pylint: disable=protected-access
|
761
|
+
if 'oilServiceDueDays' in data and data['oilServiceDueDays'] is not None:
|
762
|
+
oil_service_due: timedelta = timedelta(days=data['oilServiceDueDays'])
|
763
|
+
oil_service_date: datetime = datetime.now(tz=timezone.utc) + oil_service_due
|
764
|
+
oil_service_date = oil_service_date.replace(hour=0, minute=0, second=0, microsecond=0)
|
765
|
+
# pylint: disable-next=protected-access
|
766
|
+
vehicle.maintenance.oil_service_due_at._set_value(value=oil_service_date)
|
767
|
+
else:
|
768
|
+
vehicle.maintenance.oil_service_due_at._set_value(None) # pylint: disable=protected-access
|
769
|
+
if 'oilServiceDueKm' in data and data['oilServiceDueKm'] is not None:
|
770
|
+
vehicle.maintenance.oil_service_due_after._set_value(data['oilServiceDueKm'], unit=Length.KM) # pylint: disable=protected-access
|
771
|
+
else:
|
772
|
+
vehicle.maintenance.oil_service_due_after._set_value(None) # pylint: disable=protected-access
|
773
|
+
log_extra_keys(LOG_API, f'/v1/vehicles/{vin}/maintenance', data, {'inspectionDueDays', 'inspectionDueKm', 'oilServiceDueDays', 'oilServiceDueKm'})
|
774
|
+
else:
|
775
|
+
vehicle.odometer._set_value(None) # pylint: disable=protected-access
|
776
|
+
return vehicle
|
777
|
+
|
740
778
|
def fetch_climatisation(self, vehicle: SeatCupraVehicle, no_cache: bool = False) -> SeatCupraVehicle:
|
741
779
|
"""
|
742
780
|
Fetches the mileage of the given vehicle and updates its mileage attributes.
|
@@ -1051,27 +1089,37 @@ class Connector(BaseConnector):
|
|
1051
1089
|
if 'command' not in command_arguments:
|
1052
1090
|
raise CommandError('Command argument missing')
|
1053
1091
|
command_dict: Dict = {}
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
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'
|
1061
1102
|
else:
|
1062
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)
|
1063
1108
|
else:
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
raise CommandError(f'
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
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
|
1075
1123
|
return command_arguments
|
1076
1124
|
|
1077
1125
|
def __on_air_conditioning_start_stop(self, start_stop_command: ClimatizationStartStopCommand, command_arguments: Union[str, Dict[str, Any]]) \
|
@@ -1117,10 +1165,20 @@ class Connector(BaseConnector):
|
|
1117
1165
|
url: str = f'https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/{vin}/climatisation/requests/stop'
|
1118
1166
|
else:
|
1119
1167
|
raise CommandError(f'Unknown command {command_arguments["command"]}')
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
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
|
1124
1182
|
return command_arguments
|
1125
1183
|
|
1126
1184
|
def __on_spin(self, spin_command: SpinCommand, command_arguments: Union[str, Dict[str, Any]]) \
|
@@ -1134,7 +1192,7 @@ class Connector(BaseConnector):
|
|
1134
1192
|
if self.active_config['spin'] is None:
|
1135
1193
|
raise CommandError('S-PIN is missing, please add S-PIN to your configuration or .netrc file')
|
1136
1194
|
if 'spin' in command_arguments:
|
1137
|
-
command_dict['
|
1195
|
+
command_dict['spin'] = command_arguments['spin']
|
1138
1196
|
else:
|
1139
1197
|
if self.active_config['spin'] is None or self.active_config['spin'] == '':
|
1140
1198
|
raise CommandError('S-PIN is missing, please add S-PIN to your configuration or .netrc file')
|
@@ -1143,12 +1201,22 @@ class Connector(BaseConnector):
|
|
1143
1201
|
url = f'https://ola.prod.code.seat.cloud.vwgroup.com/v2/users/{self.session.user_id}/spin/verify'
|
1144
1202
|
else:
|
1145
1203
|
raise CommandError(f'Unknown command {command_arguments["command"]}')
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
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
|
1152
1220
|
return command_arguments
|
1153
1221
|
|
1154
1222
|
def __on_wake_sleep(self, wake_sleep_command: WakeSleepCommand, command_arguments: Union[str, Dict[str, Any]]) \
|
@@ -1167,10 +1235,20 @@ class Connector(BaseConnector):
|
|
1167
1235
|
if command_arguments['command'] == WakeSleepCommand.Command.WAKE:
|
1168
1236
|
url = f'https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/{vin}/vehicle-wakeup/request'
|
1169
1237
|
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
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
|
1174
1252
|
elif command_arguments['command'] == WakeSleepCommand.Command.SLEEP:
|
1175
1253
|
raise CommandError('Sleep command not supported by vehicle. Vehicle will put itself to sleep')
|
1176
1254
|
else:
|
@@ -1206,12 +1284,22 @@ class Connector(BaseConnector):
|
|
1206
1284
|
command_dict['userPosition']['longitude'] = vehicle.position.longitude.value
|
1207
1285
|
|
1208
1286
|
url = f'https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/{vin}/honk-and-flash'
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
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"]}')
|
1215
1303
|
return command_arguments
|
1216
1304
|
|
1217
1305
|
def __on_lock_unlock(self, lock_unlock_command: LockUnlockCommand, command_arguments: Union[str, Dict[str, Any]]) \
|
@@ -1240,10 +1328,20 @@ class Connector(BaseConnector):
|
|
1240
1328
|
url = f'https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/{vin}/access/unlock'
|
1241
1329
|
else:
|
1242
1330
|
raise CommandError(f'Unknown command {command_arguments["command"]}')
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
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
|
1247
1345
|
return command_arguments
|
1248
1346
|
|
1249
1347
|
def __on_air_conditioning_settings_change(self, attribute: GenericAttribute, value: Any) -> Any:
|
@@ -1279,10 +1377,20 @@ class Connector(BaseConnector):
|
|
1279
1377
|
setting_dict['climatisationWithoutExternalPower'] = settings.climatization_without_external_power.value
|
1280
1378
|
|
1281
1379
|
url: str = f'https://ola.prod.code.seat.cloud.vwgroup.com/v2/vehicles/{vin}/climatisation/settings'
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
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
|
1286
1394
|
return value
|
1287
1395
|
|
1288
1396
|
def get_version(self) -> str:
|
{carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/.flake8
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/.gitignore
RENAMED
File without changes
|
{carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/CHANGELOG.md
RENAMED
File without changes
|
{carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/LICENSE
RENAMED
File without changes
|
{carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/Makefile
RENAMED
File without changes
|
{carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/README.md
RENAMED
File without changes
|
File without changes
|
{carconnectivity_connector_seatcupra-0.1a5 → carconnectivity_connector_seatcupra-0.1a7}/setup.cfg
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|