carconnectivity-connector-seatcupra 0.1.2a2__py3-none-any.whl → 0.2a2__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.1.2a2.dist-info → carconnectivity_connector_seatcupra-0.2a2.dist-info}/METADATA +2 -2
- {carconnectivity_connector_seatcupra-0.1.2a2.dist-info → carconnectivity_connector_seatcupra-0.2a2.dist-info}/RECORD +7 -7
- {carconnectivity_connector_seatcupra-0.1.2a2.dist-info → carconnectivity_connector_seatcupra-0.2a2.dist-info}/WHEEL +1 -1
- carconnectivity_connectors/seatcupra/_version.py +2 -2
- carconnectivity_connectors/seatcupra/connector.py +39 -2
- {carconnectivity_connector_seatcupra-0.1.2a2.dist-info → carconnectivity_connector_seatcupra-0.2a2.dist-info}/LICENSE +0 -0
- {carconnectivity_connector_seatcupra-0.1.2a2.dist-info → carconnectivity_connector_seatcupra-0.2a2.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.2a2
|
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.5a1
|
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=ScgmPZZ2rB5sd02-ceIOSKP_pK8jHq6dsu7tkCUIFho,508
|
3
3
|
carconnectivity_connectors/seatcupra/capability.py,sha256=936V06hOX8AuAMxL_S9wVyVa36Xw1bo9081X0xf5f94,5064
|
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=LmBOCWGZPfJCG_4-5449xvO6NAvnPDsAWEBKlsG4WoI,3051
|
7
|
-
carconnectivity_connectors/seatcupra/connector.py,sha256=
|
7
|
+
carconnectivity_connectors/seatcupra/connector.py,sha256=MctN0EI7cuEzBceP51oyEBAolOuVXkv2zKgVH2GCd8I,110870
|
8
8
|
carconnectivity_connectors/seatcupra/vehicle.py,sha256=s0G-HqG5qcwStDxD3649KgLMa3lKPZ4TOGWRJEuQzsQ,3403
|
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=ZIDvC848T3fy
|
|
14
14
|
carconnectivity_connectors/seatcupra/auth/vw_web_session.py,sha256=CcI6m68IyRs6WsMDu-IsW3Dj85vyGiMmxvFqNETMHO0,10929
|
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.2a2.dist-info/LICENSE,sha256=PIwI1alwDyOfvEQHdGCm2u9uf_mGE8030xZDfun0xTo,1071
|
18
|
+
carconnectivity_connector_seatcupra-0.2a2.dist-info/METADATA,sha256=3Uya0AGBN2fa9SfgXcsFGRCYCE7G99WzJLxK5sq1evE,5473
|
19
|
+
carconnectivity_connector_seatcupra-0.2a2.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
20
|
+
carconnectivity_connector_seatcupra-0.2a2.dist-info/top_level.txt,sha256=KqA8GviZsDH4PtmnwSQsz0HB_w-TWkeEHLIRNo5dTaI,27
|
21
|
+
carconnectivity_connector_seatcupra-0.2a2.dist-info/RECORD,,
|
@@ -20,7 +20,7 @@ from carconnectivity.units import Length, Current
|
|
20
20
|
from carconnectivity.doors import Doors
|
21
21
|
from carconnectivity.windows import Windows
|
22
22
|
from carconnectivity.lights import Lights
|
23
|
-
from carconnectivity.drive import GenericDrive, ElectricDrive, CombustionDrive
|
23
|
+
from carconnectivity.drive import GenericDrive, ElectricDrive, CombustionDrive, DieselDrive
|
24
24
|
from carconnectivity.vehicle import GenericVehicle, ElectricVehicle
|
25
25
|
from carconnectivity.attributes import BooleanAttribute, DurationAttribute, GenericAttribute, TemperatureAttribute, EnumAttribute
|
26
26
|
from carconnectivity.units import Temperature
|
@@ -288,6 +288,7 @@ class Connector(BaseConnector):
|
|
288
288
|
vehicle_to_update = self.fetch_vehicle_status(vehicle_to_update)
|
289
289
|
vehicle_to_update = self.fetch_vehicle_mycar_status(vehicle_to_update)
|
290
290
|
vehicle_to_update = self.fetch_mileage(vehicle_to_update)
|
291
|
+
vehicle_to_update = self.fetch_ranges(vehicle_to_update)
|
291
292
|
if vehicle_to_update.capabilities.has_capability('climatisation', check_status_ok=True):
|
292
293
|
vehicle_to_update = self.fetch_climatisation(vehicle_to_update)
|
293
294
|
if vehicle_to_update.capabilities.has_capability('charging', check_status_ok=True):
|
@@ -414,7 +415,7 @@ class Connector(BaseConnector):
|
|
414
415
|
capability.parameters[parameter] = value
|
415
416
|
else:
|
416
417
|
raise APIError('Could not fetch capabilities, capability ID missing')
|
417
|
-
log_extra_keys(LOG_API, 'capability', capability_dict, {'id', 'expirationDate', 'editable', 'parameters'})
|
418
|
+
log_extra_keys(LOG_API, 'capability', capability_dict, {'id', 'expirationDate', 'editable', 'parameters', 'status'})
|
418
419
|
|
419
420
|
for capability_id in vehicle.capabilities.capabilities.keys() - found_capabilities:
|
420
421
|
vehicle.capabilities.remove_capability(capability_id)
|
@@ -646,6 +647,8 @@ class Connector(BaseConnector):
|
|
646
647
|
else:
|
647
648
|
if engine_type == GenericDrive.Type.ELECTRIC:
|
648
649
|
drive = ElectricDrive(drive_id=drive_id, drives=vehicle.drives)
|
650
|
+
elif engine_type == GenericDrive.Type.DIESEL:
|
651
|
+
drive = DieselDrive(drive_id=drive_id, drives=vehicle.drives)
|
649
652
|
elif engine_type in [GenericDrive.Type.FUEL,
|
650
653
|
GenericDrive.Type.GASOLINE,
|
651
654
|
GenericDrive.Type.PETROL,
|
@@ -845,6 +848,40 @@ class Connector(BaseConnector):
|
|
845
848
|
vehicle.odometer._set_value(None) # pylint: disable=protected-access
|
846
849
|
return vehicle
|
847
850
|
|
851
|
+
def fetch_ranges(self, vehicle: SeatCupraVehicle, no_cache: bool = False) -> SeatCupraVehicle:
|
852
|
+
vin = vehicle.vin.value
|
853
|
+
if vin is None:
|
854
|
+
raise APIError('VIN is missing')
|
855
|
+
url = f'https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/{vin}/ranges'
|
856
|
+
# {'ranges': [{'rangeName': 'gasolineRangeKm', 'value': 100.0}, {'rangeName': 'electricRangeKm', 'value': 28.0}]}
|
857
|
+
data: Dict[str, Any] | None = self._fetch_data(url=url, session=self.session, no_cache=no_cache)
|
858
|
+
if data is not None:
|
859
|
+
if 'ranges' in data and data['ranges'] is not None:
|
860
|
+
for drive in vehicle.drives.drives.values():
|
861
|
+
if drive.type.enabled and drive.type.value == GenericDrive.Type.ELECTRIC:
|
862
|
+
for range_dict in data['ranges']:
|
863
|
+
if 'rangeName' in range_dict and range_dict['rangeName'] is not None and range_dict['rangeName'] == 'electricRangeKm' \
|
864
|
+
and 'value' in range_dict and range_dict['value'] is not None:
|
865
|
+
drive.range._set_value(range_dict['value'], unit=Length.KM) # pylint: disable=protected-access
|
866
|
+
break
|
867
|
+
elif drive.type.enabled and drive.type.value == GenericDrive.Type.GASOLINE:
|
868
|
+
for range_dict in data['ranges']:
|
869
|
+
if 'rangeName' in range_dict and range_dict['rangeName'] is not None and range_dict['rangeName'] == 'gasolineRangeKm' \
|
870
|
+
and 'value' in range_dict and range_dict['value'] is not None:
|
871
|
+
drive.range._set_value(range_dict['value'], unit=Length.KM) # pylint: disable=protected-access
|
872
|
+
break
|
873
|
+
elif drive.type.enabled and drive.type.value == GenericDrive.Type.DIESEL:
|
874
|
+
for range_dict in data['ranges']:
|
875
|
+
if 'rangeName' in range_dict and range_dict['rangeName'] is not None and range_dict['rangeName'] == 'dieselRangeKm' \
|
876
|
+
and 'value' in range_dict and range_dict['value'] is not None:
|
877
|
+
drive.range._set_value(range_dict['value'], unit=Length.KM) # pylint: disable=protected-access
|
878
|
+
elif 'rangeName' in range_dict and range_dict['rangeName'] is not None and range_dict['rangeName'] == 'adBlueKm' \
|
879
|
+
and 'value' in range_dict and range_dict['value'] is not None:
|
880
|
+
if isinstance(drive, DieselDrive):
|
881
|
+
drive.adblue_range._set_value(range_dict['value'], unit=Length.KM) # pylint: disable=protected-access
|
882
|
+
log_extra_keys(LOG_API, f'https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/{vin}/ranges', data, {'ranges'})
|
883
|
+
return vehicle
|
884
|
+
|
848
885
|
def fetch_maintenance(self, vehicle: SeatCupraVehicle, no_cache: bool = False) -> SeatCupraVehicle:
|
849
886
|
vin = vehicle.vin.value
|
850
887
|
if vin is None:
|
File without changes
|