carconnectivity-connector-seatcupra 0.2a4__py3-none-any.whl → 0.2a5__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.2a4.dist-info → carconnectivity_connector_seatcupra-0.2a5.dist-info}/METADATA +3 -2
- {carconnectivity_connector_seatcupra-0.2a4.dist-info → carconnectivity_connector_seatcupra-0.2a5.dist-info}/RECORD +9 -9
- {carconnectivity_connector_seatcupra-0.2a4.dist-info → carconnectivity_connector_seatcupra-0.2a5.dist-info}/WHEEL +1 -1
- carconnectivity_connectors/seatcupra/_version.py +2 -2
- carconnectivity_connectors/seatcupra/charging.py +16 -1
- carconnectivity_connectors/seatcupra/connector.py +155 -18
- carconnectivity_connectors/seatcupra/vehicle.py +8 -0
- {carconnectivity_connector_seatcupra-0.2a4.dist-info → carconnectivity_connector_seatcupra-0.2a5.dist-info/licenses}/LICENSE +0 -0
- {carconnectivity_connector_seatcupra-0.2a4.dist-info → carconnectivity_connector_seatcupra-0.2a5.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: carconnectivity-connector-seatcupra
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.2a5
|
4
4
|
Summary: CarConnectivity connector for Seat and Cupra services
|
5
5
|
Author: Till Steinbach
|
6
6
|
License: MIT License
|
@@ -41,6 +41,7 @@ Requires-Dist: carconnectivity>=0.5a4
|
|
41
41
|
Requires-Dist: oauthlib~=3.2.2
|
42
42
|
Requires-Dist: requests~=2.32.3
|
43
43
|
Requires-Dist: jwt~=1.3.1
|
44
|
+
Dynamic: license-file
|
44
45
|
|
45
46
|
|
46
47
|
|
@@ -1,11 +1,12 @@
|
|
1
|
+
carconnectivity_connector_seatcupra-0.2a5.dist-info/licenses/LICENSE,sha256=PIwI1alwDyOfvEQHdGCm2u9uf_mGE8030xZDfun0xTo,1071
|
1
2
|
carconnectivity_connectors/seatcupra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
carconnectivity_connectors/seatcupra/_version.py,sha256=
|
3
|
+
carconnectivity_connectors/seatcupra/_version.py,sha256=gBBVklnLddS1IBpDXSdeUYTr2XaGy46iAMvj39V3VYo,514
|
3
4
|
carconnectivity_connectors/seatcupra/capability.py,sha256=936V06hOX8AuAMxL_S9wVyVa36Xw1bo9081X0xf5f94,5064
|
4
|
-
carconnectivity_connectors/seatcupra/charging.py,sha256=
|
5
|
+
carconnectivity_connectors/seatcupra/charging.py,sha256=mayvseay5x2r2qjWqol0ijlgoBL2L2A0A96T44FOiHg,4076
|
5
6
|
carconnectivity_connectors/seatcupra/climatization.py,sha256=0xxWlxrheAPzkVT8WRQtbm6ExZmVdgW7lUdOXyS_qWY,1695
|
6
7
|
carconnectivity_connectors/seatcupra/command_impl.py,sha256=LmBOCWGZPfJCG_4-5449xvO6NAvnPDsAWEBKlsG4WoI,3051
|
7
|
-
carconnectivity_connectors/seatcupra/connector.py,sha256=
|
8
|
-
carconnectivity_connectors/seatcupra/vehicle.py,sha256
|
8
|
+
carconnectivity_connectors/seatcupra/connector.py,sha256=_8Lvg1yqHHbH4mkhThwq0KZZL64rzKoFYurQCQurqY4,130482
|
9
|
+
carconnectivity_connectors/seatcupra/vehicle.py,sha256=LHkAlVD_C8xOX81wCGFZbZqyhctpKx-CN0T3NZJ2jFk,3946
|
9
10
|
carconnectivity_connectors/seatcupra/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
11
|
carconnectivity_connectors/seatcupra/auth/auth_util.py,sha256=Y81h8fGOMSMgPtE4wI_TI9WgE_s43uaPjRLBBINhj4g,4433
|
11
12
|
carconnectivity_connectors/seatcupra/auth/my_cupra_session.py,sha256=VF_9U8fESLkndVaPn2W1ZxZwNr9-ndeaegeTVT5FyYk,13904
|
@@ -14,8 +15,7 @@ carconnectivity_connectors/seatcupra/auth/session_manager.py,sha256=ZIDvC848T3fy
|
|
14
15
|
carconnectivity_connectors/seatcupra/auth/vw_web_session.py,sha256=CcI6m68IyRs6WsMDu-IsW3Dj85vyGiMmxvFqNETMHO0,10929
|
15
16
|
carconnectivity_connectors/seatcupra/auth/helpers/blacklist_retry.py,sha256=f3wsiY5bpHDBxp7Va1Mv9nKJ4u3qnCHZZmDu78_AhMk,1251
|
16
17
|
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.2a4.dist-info/RECORD,,
|
18
|
+
carconnectivity_connector_seatcupra-0.2a5.dist-info/METADATA,sha256=GNrJzfeFo_OxXxnlEzUuZWQZlOrczneqpa-tD_iqPRk,5495
|
19
|
+
carconnectivity_connector_seatcupra-0.2a5.dist-info/WHEEL,sha256=tTnHoFhvKQHCh4jz3yCn0WPTYIy7wXx3CJtJ7SJGV7c,91
|
20
|
+
carconnectivity_connector_seatcupra-0.2a5.dist-info/top_level.txt,sha256=KqA8GviZsDH4PtmnwSQsz0HB_w-TWkeEHLIRNo5dTaI,27
|
21
|
+
carconnectivity_connector_seatcupra-0.2a5.dist-info/RECORD,,
|
@@ -12,6 +12,8 @@ from carconnectivity.vehicle import ElectricVehicle
|
|
12
12
|
if TYPE_CHECKING:
|
13
13
|
from typing import Optional, Dict
|
14
14
|
|
15
|
+
from carconnectivity.objects import GenericObject
|
16
|
+
|
15
17
|
|
16
18
|
class SeatCupraCharging(Charging): # pylint: disable=too-many-instance-attributes
|
17
19
|
"""
|
@@ -22,9 +24,22 @@ class SeatCupraCharging(Charging): # pylint: disable=too-many-instance-attribut
|
|
22
24
|
"""
|
23
25
|
def __init__(self, vehicle: ElectricVehicle | None = None, origin: Optional[Charging] = None) -> None:
|
24
26
|
if origin is not None:
|
25
|
-
super().__init__(origin=origin)
|
27
|
+
super().__init__(vehicle=vehicle, origin=origin)
|
28
|
+
self.settings = SeatCupraCharging.Settings(parent=self, origin=origin.settings)
|
26
29
|
else:
|
27
30
|
super().__init__(vehicle=vehicle)
|
31
|
+
self.settings = SeatCupraCharging.Settings(parent=self, origin=self.settings)
|
32
|
+
|
33
|
+
class Settings(Charging.Settings):
|
34
|
+
"""
|
35
|
+
This class represents the settings for car volkswagen car charging.
|
36
|
+
"""
|
37
|
+
def __init__(self, parent: Optional[GenericObject] = None, origin: Optional[Charging.Settings] = None) -> None:
|
38
|
+
if origin is not None:
|
39
|
+
super().__init__(parent=parent, origin=origin)
|
40
|
+
else:
|
41
|
+
super().__init__(parent=parent)
|
42
|
+
self.max_current_in_ampere: Optional[bool] = None
|
28
43
|
|
29
44
|
class SeatCupraChargingState(Enum,):
|
30
45
|
"""
|
@@ -22,7 +22,8 @@ from carconnectivity.windows import Windows
|
|
22
22
|
from carconnectivity.lights import Lights
|
23
23
|
from carconnectivity.drive import GenericDrive, ElectricDrive, CombustionDrive, DieselDrive
|
24
24
|
from carconnectivity.vehicle import GenericVehicle, ElectricVehicle
|
25
|
-
from carconnectivity.attributes import BooleanAttribute, DurationAttribute, GenericAttribute, TemperatureAttribute, EnumAttribute
|
25
|
+
from carconnectivity.attributes import BooleanAttribute, DurationAttribute, GenericAttribute, TemperatureAttribute, EnumAttribute, CurrentAttribute, \
|
26
|
+
LevelAttribute
|
26
27
|
from carconnectivity.units import Temperature
|
27
28
|
from carconnectivity.command_impl import ClimatizationStartStopCommand, WakeSleepCommand, HonkAndFlashCommand, LockUnlockCommand, ChargingStartStopCommand, \
|
28
29
|
WindowHeatingStartStopCommand
|
@@ -1132,22 +1133,84 @@ class Connector(BaseConnector):
|
|
1132
1133
|
log_extra_keys(LOG_API, f'https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/{vin}/charging/status', data,
|
1133
1134
|
{'state', 'battery', 'charging', 'plug'})
|
1134
1135
|
|
1135
|
-
url = f'https://ola.prod.code.seat.cloud.vwgroup.com/
|
1136
|
+
url = f'https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/{vin}/charging/settings'
|
1136
1137
|
data: Dict[str, Any] | None = self._fetch_data(url=url, session=self.session, no_cache=no_cache)
|
1137
1138
|
if data is not None:
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1139
|
+
# {'settings': {'maxChargeCurrentAC': 'reduced', 'carCapturedTimestamp': '2025-03-18T16:50:33Z', 'autoUnlockPlugWhenCharged': None, 'targetSoc_pct': 100, 'batteryCareTargetSocPercentage': 80}}
|
1140
|
+
if 'settings' in data and data['settings'] is not None:
|
1141
|
+
if 'carCapturedTimestamp' not in data['settings'] or data['settings']['carCapturedTimestamp'] is None:
|
1142
|
+
raise APIError('Could not fetch vehicle status, carCapturedTimestamp missing')
|
1143
|
+
captured_at: datetime = robust_time_parse(data['settings']['carCapturedTimestamp'])
|
1144
|
+
if 'maxChargeCurrentAC_A' in data['settings'] and data['settings']['maxChargeCurrentAC_A'] is not None:
|
1145
|
+
if isinstance(vehicle.charging.settings, SeatCupraCharging.Settings):
|
1146
|
+
vehicle.charging.settings.max_current_in_ampere = True
|
1147
|
+
else:
|
1148
|
+
raise ValueError('Charging settings not of type VolkswagenCharging.Settings')
|
1149
|
+
vehicle.charging.settings.maximum_current.minimum = 6.0
|
1150
|
+
vehicle.charging.settings.maximum_current.maximum = 16.0
|
1151
|
+
vehicle.charging.settings.maximum_current.precision = 1.0
|
1152
|
+
# pylint: disable-next=protected-access
|
1153
|
+
vehicle.charging.settings.maximum_current._add_on_set_hook(self.__on_charging_settings_change)
|
1154
|
+
vehicle.charging.settings.maximum_current._is_changeable = True # pylint: disable=protected-access
|
1155
|
+
vehicle.charging.settings.maximum_current._set_value(data['settings']['maxChargeCurrentAC_A'], # pylint: disable=protected-access
|
1156
|
+
measured=captured_at)
|
1157
|
+
elif 'maxChargeCurrentAC' in data['settings'] and data['settings']['maxChargeCurrentAC'] is not None:
|
1158
|
+
if isinstance(vehicle.charging.settings, SeatCupraCharging.Settings):
|
1159
|
+
vehicle.charging.settings.max_current_in_ampere = False
|
1160
|
+
else:
|
1161
|
+
raise ValueError('Charging settings not of type VolkswagenCharging.Settings')
|
1162
|
+
vehicle.charging.settings.maximum_current.minimum = 6.0
|
1163
|
+
vehicle.charging.settings.maximum_current.maximum = 16.0
|
1164
|
+
vehicle.charging.settings.maximum_current.precision = 1.0
|
1165
|
+
# pylint: disable-next=protected-access
|
1166
|
+
vehicle.charging.settings.maximum_current._add_on_set_hook(self.__on_charging_settings_change)
|
1167
|
+
vehicle.charging.settings.maximum_current._is_changeable = True # pylint: disable=protected-access
|
1168
|
+
if data['settings']['maxChargeCurrentAC'] == 'maximum':
|
1169
|
+
vehicle.charging.settings.maximum_current._set_value(16.0, # pylint: disable=protected-access
|
1170
|
+
measured=captured_at)
|
1171
|
+
elif data['settings']['maxChargeCurrentAC'] == 'reduced':
|
1172
|
+
vehicle.charging.settings.maximum_current._set_value(6.0, # pylint: disable=protected-access
|
1173
|
+
measured=captured_at)
|
1174
|
+
else:
|
1175
|
+
LOG_API.info('Unknown max charge current %s', data['settings']['maxChargeCurrentAC'])
|
1176
|
+
vehicle.charging.settings.maximum_current._set_value(None, measured=captured_at) # pylint: disable=protected-access
|
1142
1177
|
else:
|
1143
|
-
vehicle.charging.settings.maximum_current._set_value(
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1178
|
+
vehicle.charging.settings.maximum_current._set_value(None, measured=captured_at) # pylint: disable=protected-access
|
1179
|
+
if 'autoUnlockPlugWhenCharged' in data['settings'] and data['settings']['autoUnlockPlugWhenCharged'] is not None:
|
1180
|
+
# pylint: disable-next=protected-access
|
1181
|
+
vehicle.charging.settings.auto_unlock._add_on_set_hook(self.__on_charging_settings_change)
|
1182
|
+
vehicle.charging.settings.auto_unlock._is_changeable = True # pylint: disable=protected-access
|
1183
|
+
if data['settings']['autoUnlockPlugWhenCharged'] == 'on':
|
1184
|
+
vehicle.charging.settings.auto_unlock._set_value(True, # pylint: disable=protected-access
|
1185
|
+
measured=captured_at)
|
1186
|
+
elif data['settings']['autoUnlockPlugWhenCharged'] == 'off':
|
1187
|
+
vehicle.charging.settings.auto_unlock._set_value(False, # pylint: disable=protected-access
|
1188
|
+
measured=captured_at)
|
1189
|
+
else:
|
1190
|
+
LOG_API.info('Unknown auto unlock plug when charged %s', data['settings']['autoUnlockPlugWhenCharged'])
|
1191
|
+
vehicle.charging.settings.auto_unlock._set_value(None, measured=captured_at) # pylint: disable=protected-access
|
1192
|
+
else:
|
1193
|
+
vehicle.charging.settings.auto_unlock._set_value(None, measured=captured_at) # pylint: disable=protected-access
|
1194
|
+
if 'targetSoc_pct' in data['settings'] and data['settings']['targetSoc_pct'] is not None:
|
1195
|
+
charging_capability: Optional[Capability] = vehicle.capabilities.get_capability('charging')
|
1196
|
+
if charging_capability is not None and ('supportsTargetStateOfCharge' not in charging_capability.parameters
|
1197
|
+
or charging_capability.parameters['supportsTargetStateOfCharge'] != 'false'):
|
1198
|
+
vehicle.charging.settings.target_level.minimum = 50.0
|
1199
|
+
vehicle.charging.settings.target_level.maximum = 100.0
|
1200
|
+
vehicle.charging.settings.target_level.precision = 10.0
|
1201
|
+
# pylint: disable-next=protected-access
|
1202
|
+
vehicle.charging.settings.target_level._add_on_set_hook(self.__on_charging_settings_change)
|
1203
|
+
vehicle.charging.settings.target_level._is_changeable = True # pylint: disable=protected-access
|
1204
|
+
vehicle.charging.settings.target_level._set_value(data['settings']['targetSoc_pct'], # pylint: disable=protected-access
|
1205
|
+
measured=captured_at)
|
1206
|
+
else:
|
1207
|
+
vehicle.charging.settings.target_level._set_value(None, measured=captured_at) # pylint: disable=protected-access
|
1208
|
+
log_extra_keys(LOG_API, 'chargingSettings', data['settings'], {'carCapturedTimestamp', 'maxChargeCurrentAC_A', 'maxChargeCurrentAC',
|
1209
|
+
'autoUnlockPlugWhenCharged', 'targetSoc_pct'})
|
1210
|
+
else:
|
1211
|
+
vehicle.charging.settings.maximum_current._set_value(None) # pylint: disable=protected-access
|
1212
|
+
vehicle.charging.settings.auto_unlock._set_value(None) # pylint: disable=protected-access
|
1213
|
+
vehicle.charging.settings.target_level._set_value(None) # pylint: disable=protected-access
|
1151
1214
|
return vehicle
|
1152
1215
|
|
1153
1216
|
def fetch_image(self, vehicle: SeatCupraVehicle, no_cache: bool = False) -> SeatCupraVehicle:
|
@@ -1594,10 +1657,13 @@ class Connector(BaseConnector):
|
|
1594
1657
|
setting_dict['targetTemperatureUnit'] = 'farenheit'
|
1595
1658
|
else:
|
1596
1659
|
setting_dict['targetTemperatureUnit'] = 'celsius'
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1660
|
+
climatization_capability: Optional[Capability] = vehicle.capabilities.get_capability('climatisation')
|
1661
|
+
if climatization_capability is not None and ('supportsOffGridClimatisation' not in climatization_capability.parameters
|
1662
|
+
or climatization_capability.parameters['supportsOffGridClimatisation'] != 'false'):
|
1663
|
+
if isinstance(attribute, BooleanAttribute) and attribute.id == 'climatisation_without_external_power':
|
1664
|
+
setting_dict['climatisationWithoutExternalPower'] = value
|
1665
|
+
elif settings.climatization_without_external_power.enabled and settings.climatization_without_external_power.value is not None:
|
1666
|
+
setting_dict['climatisationWithoutExternalPower'] = settings.climatization_without_external_power.value
|
1601
1667
|
|
1602
1668
|
url: str = f'https://ola.prod.code.seat.cloud.vwgroup.com/v2/vehicles/{vin}/climatisation/settings'
|
1603
1669
|
try:
|
@@ -1653,6 +1719,77 @@ class Connector(BaseConnector):
|
|
1653
1719
|
raise CommandError(f'Retrying failed: {retry_error}') from retry_error
|
1654
1720
|
return command_arguments
|
1655
1721
|
|
1722
|
+
def __on_charging_settings_change(self, attribute: GenericAttribute, value: Any) -> Any:
|
1723
|
+
"""
|
1724
|
+
Callback for the charging setting change.
|
1725
|
+
"""
|
1726
|
+
if attribute.parent is None or not isinstance(attribute.parent, SeatCupraCharging.Settings) \
|
1727
|
+
or attribute.parent.parent is None \
|
1728
|
+
or attribute.parent.parent.parent is None or not isinstance(attribute.parent.parent.parent, SeatCupraVehicle):
|
1729
|
+
raise SetterError('Object hierarchy is not as expected')
|
1730
|
+
settings: SeatCupraCharging.Settings = attribute.parent
|
1731
|
+
vehicle: SeatCupraVehicle = attribute.parent.parent.parent
|
1732
|
+
vin: Optional[str] = vehicle.vin.value
|
1733
|
+
if vin is None:
|
1734
|
+
raise SetterError('VIN in object hierarchy missing')
|
1735
|
+
setting_dict = {}
|
1736
|
+
precision: float = settings.maximum_current.precision if settings.maximum_current.precision is not None else 1.0
|
1737
|
+
if isinstance(attribute, CurrentAttribute) and attribute.id == 'maximum_current':
|
1738
|
+
value = round(value / precision) * precision
|
1739
|
+
if settings.max_current_in_ampere:
|
1740
|
+
setting_dict['maxChargeCurrentAcInAmperes'] = value
|
1741
|
+
else:
|
1742
|
+
if value < 6:
|
1743
|
+
raise SetterError('Maximum current must be greater than 6 amps')
|
1744
|
+
if value < 16:
|
1745
|
+
setting_dict['maxChargeCurrentAc'] = 'reduced'
|
1746
|
+
value = 6.0
|
1747
|
+
else:
|
1748
|
+
setting_dict['maxChargeCurrentAc'] = 'maximum'
|
1749
|
+
value = 16.0
|
1750
|
+
elif settings.maximum_current.enabled and settings.maximum_current.value is not None:
|
1751
|
+
if settings.max_current_in_ampere:
|
1752
|
+
setting_dict['maxChargeCurrentAc_A'] = round(settings.maximum_current.value / precision) * precision
|
1753
|
+
else:
|
1754
|
+
if settings.maximum_current.value < 6:
|
1755
|
+
raise SetterError('Maximum current must be greater than 6 amps')
|
1756
|
+
if settings.maximum_current.value < 16:
|
1757
|
+
setting_dict['maxChargeCurrentAc'] = 'reduced'
|
1758
|
+
settings.maximum_current.value = 6.0
|
1759
|
+
else:
|
1760
|
+
setting_dict['maxChargeCurrentAc'] = 'maximum'
|
1761
|
+
settings.maximum_current.value = 16.0
|
1762
|
+
if isinstance(attribute, BooleanAttribute) and attribute.id == 'auto_unlock':
|
1763
|
+
setting_dict['autoUnlockPlugWhenChargedAc'] = 'on' if value else 'off'
|
1764
|
+
elif settings.auto_unlock.enabled and settings.auto_unlock.value is not None:
|
1765
|
+
setting_dict['autoUnlockPlugWhenChargedAc'] = 'on' if settings.auto_unlock.value else 'off'
|
1766
|
+
charging_capability: Optional[Capability] = vehicle.capabilities.get_capability('charging')
|
1767
|
+
if charging_capability is not None and ('supportsTargetStateOfCharge' not in charging_capability.parameters
|
1768
|
+
or charging_capability.parameters['supportsTargetStateOfCharge'] != 'false'):
|
1769
|
+
precision: float = settings.target_level.precision if settings.target_level.precision is not None else 10.0
|
1770
|
+
if isinstance(attribute, LevelAttribute) and attribute.id == 'target_level':
|
1771
|
+
value = round(value / precision) * precision
|
1772
|
+
setting_dict['targetSoc'] = value
|
1773
|
+
elif settings.target_level.enabled and settings.target_level.value is not None:
|
1774
|
+
setting_dict['targetSoc'] = round(settings.target_level.value / precision) * precision
|
1775
|
+
|
1776
|
+
url: str = f'https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/{vin}/charging/settings'
|
1777
|
+
try:
|
1778
|
+
settings_response: requests.Response = self.session.post(url, data=json.dumps(setting_dict), allow_redirects=True)
|
1779
|
+
if settings_response.status_code not in [requests.codes['ok'], requests.codes['created']]:
|
1780
|
+
LOG.error('Could not set charging settings (%s)', settings_response.status_code)
|
1781
|
+
raise SetterError(f'Could not set value ({settings_response.status_code})')
|
1782
|
+
except requests.exceptions.ConnectionError as connection_error:
|
1783
|
+
raise SetterError(f'Connection error: {connection_error}.'
|
1784
|
+
' If this happens frequently, please check if other applications communicate with the Volkswagen server.') from connection_error
|
1785
|
+
except requests.exceptions.ChunkedEncodingError as chunked_encoding_error:
|
1786
|
+
raise SetterError(f'Error: {chunked_encoding_error}') from chunked_encoding_error
|
1787
|
+
except requests.exceptions.ReadTimeout as timeout_error:
|
1788
|
+
raise SetterError(f'Timeout during read: {timeout_error}') from timeout_error
|
1789
|
+
except requests.exceptions.RetryError as retry_error:
|
1790
|
+
raise SetterError(f'Retrying failed: {retry_error}') from retry_error
|
1791
|
+
return value
|
1792
|
+
|
1656
1793
|
def get_version(self) -> str:
|
1657
1794
|
return __version__
|
1658
1795
|
|
@@ -6,6 +6,7 @@ from carconnectivity.vehicle import GenericVehicle, ElectricVehicle, CombustionV
|
|
6
6
|
|
7
7
|
from carconnectivity_connectors.seatcupra.capability import Capabilities
|
8
8
|
from carconnectivity_connectors.seatcupra.climatization import SeatCupraClimatization
|
9
|
+
from carconnectivity_connectors.seatcupra.charging import SeatCupraCharging
|
9
10
|
|
10
11
|
SUPPORT_IMAGES = False
|
11
12
|
try:
|
@@ -17,6 +18,8 @@ except ImportError:
|
|
17
18
|
if TYPE_CHECKING:
|
18
19
|
from typing import Optional, Dict
|
19
20
|
from carconnectivity.garage import Garage
|
21
|
+
from carconnectivity.charging import Charging
|
22
|
+
|
20
23
|
from carconnectivity_connectors.base.connector import BaseConnector
|
21
24
|
|
22
25
|
|
@@ -55,8 +58,13 @@ class SeatCupraElectricVehicle(ElectricVehicle, SeatCupraVehicle):
|
|
55
58
|
origin: Optional[SeatCupraVehicle] = None) -> None:
|
56
59
|
if origin is not None:
|
57
60
|
super().__init__(garage=garage, origin=origin)
|
61
|
+
if isinstance(origin, ElectricVehicle):
|
62
|
+
self.charging: Charging = SeatCupraCharging(vehicle=self, origin=origin.charging)
|
63
|
+
else:
|
64
|
+
self.charging: Charging = SeatCupraCharging(vehicle=self, origin=self.charging)
|
58
65
|
else:
|
59
66
|
super().__init__(vin=vin, garage=garage, managing_connector=managing_connector)
|
67
|
+
self.charging: Charging = SeatCupraCharging(vehicle=self, origin=self.charging)
|
60
68
|
|
61
69
|
|
62
70
|
class SeatCupraCombustionVehicle(CombustionVehicle, SeatCupraVehicle):
|
File without changes
|