carconnectivity-connector-seatcupra 0.1a5__py3-none-any.whl → 0.1a6__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.
- {carconnectivity_connector_seatcupra-0.1a5.dist-info → carconnectivity_connector_seatcupra-0.1a6.dist-info}/METADATA +2 -2
- {carconnectivity_connector_seatcupra-0.1a5.dist-info → carconnectivity_connector_seatcupra-0.1a6.dist-info}/RECORD +7 -7
- carconnectivity_connectors/seatcupra/_version.py +1 -1
- carconnectivity_connectors/seatcupra/connector.py +40 -2
- {carconnectivity_connector_seatcupra-0.1a5.dist-info → carconnectivity_connector_seatcupra-0.1a6.dist-info}/LICENSE +0 -0
- {carconnectivity_connector_seatcupra-0.1a5.dist-info → carconnectivity_connector_seatcupra-0.1a6.dist-info}/WHEEL +0 -0
- {carconnectivity_connector_seatcupra-0.1a5.dist-info → carconnectivity_connector_seatcupra-0.1a6.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: carconnectivity-connector-seatcupra
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.1a6
|
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,10 +1,10 @@
|
|
1
1
|
carconnectivity_connectors/seatcupra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
carconnectivity_connectors/seatcupra/_version.py,sha256=
|
2
|
+
carconnectivity_connectors/seatcupra/_version.py,sha256=Hqe2m1dzf7-6SjKo8Gr6gXy8XAO0Guujh7xUPL78VzY,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=
|
7
|
+
carconnectivity_connectors/seatcupra/connector.py,sha256=S6E7YlS8j39MPhV04ghOekevs53eEsZTlLyn7beeiMM,92982
|
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.
|
18
|
-
carconnectivity_connector_seatcupra-0.
|
19
|
-
carconnectivity_connector_seatcupra-0.
|
20
|
-
carconnectivity_connector_seatcupra-0.
|
21
|
-
carconnectivity_connector_seatcupra-0.
|
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,,
|
@@ -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.
|
@@ -1062,7 +1100,7 @@ class Connector(BaseConnector):
|
|
1062
1100
|
command_dict['maxChargeCurrentAC'] = 'maximum'
|
1063
1101
|
else:
|
1064
1102
|
command_dict['maxChargeCurrentAC'] = 'maximum'
|
1065
|
-
command_response: requests.Response = self.session.post(url,
|
1103
|
+
command_response: requests.Response = self.session.post(url, json=command_dict, allow_redirects=True)
|
1066
1104
|
elif command_arguments['command'] == ChargingStartStopCommand.Command.STOP:
|
1067
1105
|
url = f'https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/{vin}/charging/requests/stop'
|
1068
1106
|
command_response: requests.Response = self.session.post(url, data='{}', allow_redirects=True)
|
@@ -1134,7 +1172,7 @@ class Connector(BaseConnector):
|
|
1134
1172
|
if self.active_config['spin'] is None:
|
1135
1173
|
raise CommandError('S-PIN is missing, please add S-PIN to your configuration or .netrc file')
|
1136
1174
|
if 'spin' in command_arguments:
|
1137
|
-
command_dict['
|
1175
|
+
command_dict['spin'] = command_arguments['spin']
|
1138
1176
|
else:
|
1139
1177
|
if self.active_config['spin'] is None or self.active_config['spin'] == '':
|
1140
1178
|
raise CommandError('S-PIN is missing, please add S-PIN to your configuration or .netrc file')
|
File without changes
|
File without changes
|