carconnectivity-connector-skoda 0.5a1__tar.gz → 0.6__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.
Potentially problematic release.
This version of carconnectivity-connector-skoda might be problematic. Click here for more details.
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/CHANGELOG.md +17 -1
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/PKG-INFO +4 -3
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/pyproject.toml +1 -1
- carconnectivity_connector_skoda-0.6/setup_requirements.txt +6 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connector_skoda.egg-info/PKG-INFO +4 -3
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connector_skoda.egg-info/requires.txt +1 -1
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/_version.py +2 -2
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/charging.py +4 -4
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/command_impl.py +5 -1
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/connector.py +140 -6
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/ui/connector_ui.py +2 -2
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/vehicle.py +8 -7
- carconnectivity_connector_skoda-0.5a1/setup_requirements.txt +0 -6
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/.flake8 +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/.github/dependabot.yml +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/.github/workflows/build.yml +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/.github/workflows/build_and_publish.yml +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/.github/workflows/codeql-analysis.yml +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/.gitignore +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/LICENSE +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/Makefile +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/README.md +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/doc/Config.md +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/setup.cfg +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connector_skoda.egg-info/SOURCES.txt +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connector_skoda.egg-info/dependency_links.txt +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connector_skoda.egg-info/top_level.txt +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/__init__.py +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/auth/__init__.py +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/auth/auth_util.py +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/auth/helpers/blacklist_retry.py +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/auth/my_skoda_session.py +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/auth/openid_session.py +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/auth/session_manager.py +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/auth/skoda_web_session.py +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/capability.py +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/climatization.py +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/error.py +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/src/carconnectivity_connectors/skoda/mqtt_client.py +0 -0
- {carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/test/integration_test/carConnectivity.json +0 -0
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
- No unreleased changes so far
|
|
7
7
|
|
|
8
|
+
## [0.6] - 2025-04-02
|
|
9
|
+
### Fixed
|
|
10
|
+
- Only fetch range when measurement capability is available (fix for older cars)
|
|
11
|
+
- Allowes to have multiple instances of this connector running
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## [0.5] - 2025-03-20
|
|
17
|
+
### Added
|
|
18
|
+
- Support for window heating attributes
|
|
19
|
+
- Support for window heating command
|
|
20
|
+
- SUpport for changing charging settings
|
|
21
|
+
|
|
8
22
|
## [0.4.1] - 2025-03-04
|
|
9
23
|
### Fixed
|
|
10
24
|
- Fixed potential http error when parking position was fetched but due to error not available
|
|
@@ -37,7 +51,9 @@ All notable changes to this project will be documented in this file.
|
|
|
37
51
|
Initial release, let's go and give this to the public to try out...
|
|
38
52
|
The API is not yet implemented completely but most functions already work
|
|
39
53
|
|
|
40
|
-
[unreleased]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/compare/v0.
|
|
54
|
+
[unreleased]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/compare/v0.6...HEAD
|
|
55
|
+
[0.6]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.6
|
|
56
|
+
[0.5]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.5
|
|
41
57
|
[0.4.1]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.4.1
|
|
42
58
|
[0.4]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.4
|
|
43
59
|
[0.3]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: carconnectivity-connector-skoda
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6
|
|
4
4
|
Summary: CarConnectivity connector for Skoda services
|
|
5
5
|
Author: Till Steinbach
|
|
6
6
|
License: MIT License
|
|
@@ -37,11 +37,12 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
37
37
|
Requires-Python: >=3.8
|
|
38
38
|
Description-Content-Type: text/markdown
|
|
39
39
|
License-File: LICENSE
|
|
40
|
-
Requires-Dist: carconnectivity>=0.
|
|
40
|
+
Requires-Dist: carconnectivity>=0.6
|
|
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
44
|
Requires-Dist: paho-mqtt~=2.1.0
|
|
45
|
+
Dynamic: license-file
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: carconnectivity-connector-skoda
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6
|
|
4
4
|
Summary: CarConnectivity connector for Skoda services
|
|
5
5
|
Author: Till Steinbach
|
|
6
6
|
License: MIT License
|
|
@@ -37,11 +37,12 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
37
37
|
Requires-Python: >=3.8
|
|
38
38
|
Description-Content-Type: text/markdown
|
|
39
39
|
License-File: LICENSE
|
|
40
|
-
Requires-Dist: carconnectivity>=0.
|
|
40
|
+
Requires-Dist: carconnectivity>=0.6
|
|
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
44
|
Requires-Dist: paho-mqtt~=2.1.0
|
|
45
|
+
Dynamic: license-file
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
|
|
@@ -26,11 +26,11 @@ class SkodaCharging(Charging): # pylint: disable=too-many-instance-attributes
|
|
|
26
26
|
"""
|
|
27
27
|
def __init__(self, vehicle: ElectricVehicle | None = None, origin: Optional[Charging] = None) -> None:
|
|
28
28
|
if origin is not None:
|
|
29
|
-
super().__init__(origin=origin)
|
|
30
|
-
self.settings: Charging.Settings = SkodaCharging.Settings(origin=origin.settings)
|
|
29
|
+
super().__init__(vehicle=vehicle, origin=origin)
|
|
30
|
+
self.settings: Charging.Settings = SkodaCharging.Settings(parent=self, origin=origin.settings)
|
|
31
31
|
else:
|
|
32
32
|
super().__init__(vehicle=vehicle)
|
|
33
|
-
self.settings: Charging.Settings = SkodaCharging.Settings(origin=self.settings)
|
|
33
|
+
self.settings: Charging.Settings = SkodaCharging.Settings(parent=self, origin=self.settings)
|
|
34
34
|
self.errors: Dict[str, Error] = {}
|
|
35
35
|
self.is_in_saved_location: BooleanAttribute = BooleanAttribute("is_in_saved_location", parent=self, tags={'connector_custom'})
|
|
36
36
|
|
|
@@ -40,7 +40,7 @@ class SkodaCharging(Charging): # pylint: disable=too-many-instance-attributes
|
|
|
40
40
|
"""
|
|
41
41
|
def __init__(self, parent: Optional[GenericObject] = None, origin: Optional[Charging.Settings] = None) -> None:
|
|
42
42
|
if origin is not None:
|
|
43
|
-
super().__init__(origin=origin)
|
|
43
|
+
super().__init__(parent=parent, origin=origin)
|
|
44
44
|
else:
|
|
45
45
|
super().__init__(parent=parent)
|
|
46
46
|
self.preferred_charge_mode: EnumAttribute = EnumAttribute("preferred_charge_mode", parent=self, tags={'connector_custom'})
|
|
@@ -33,7 +33,11 @@ class SpinCommand(GenericCommand):
|
|
|
33
33
|
def value(self, new_value: Optional[Union[str, Dict]]) -> None:
|
|
34
34
|
# Execute early hooks before parsing the value
|
|
35
35
|
new_value = self._execute_on_set_hook(new_value, early_hook=True)
|
|
36
|
-
if isinstance(new_value,
|
|
36
|
+
if isinstance(new_value, SpinCommand.Command):
|
|
37
|
+
newvalue_dict = {}
|
|
38
|
+
newvalue_dict['command'] = new_value
|
|
39
|
+
new_value = newvalue_dict
|
|
40
|
+
elif isinstance(new_value, str):
|
|
37
41
|
parser = ThrowingArgumentParser(prog='', add_help=False, exit_on_error=False)
|
|
38
42
|
parser.add_argument('command', help='Command to execute', type=SpinCommand.Command,
|
|
39
43
|
choices=list(SpinCommand.Command))
|
|
@@ -23,7 +23,8 @@ from carconnectivity.doors import Doors
|
|
|
23
23
|
from carconnectivity.windows import Windows
|
|
24
24
|
from carconnectivity.lights import Lights
|
|
25
25
|
from carconnectivity.drive import GenericDrive, ElectricDrive, CombustionDrive
|
|
26
|
-
from carconnectivity.attributes import
|
|
26
|
+
from carconnectivity.attributes import BooleanAttribute, DurationAttribute, TemperatureAttribute, EnumAttribute, LevelAttribute, \
|
|
27
|
+
CurrentAttribute
|
|
27
28
|
from carconnectivity.charging import Charging
|
|
28
29
|
from carconnectivity.position import Position
|
|
29
30
|
from carconnectivity.climatization import Climatization
|
|
@@ -327,6 +328,9 @@ class Connector(BaseConnector):
|
|
|
327
328
|
if 'vehicles' in data and data['vehicles'] is not None:
|
|
328
329
|
for vehicle_dict in data['vehicles']:
|
|
329
330
|
if 'vin' in vehicle_dict and vehicle_dict['vin'] is not None:
|
|
331
|
+
if vehicle_dict['vin'] in self.active_config['hide_vins']:
|
|
332
|
+
LOG.info('Vehicle %s filtered out due to configuration', vehicle_dict['vin'])
|
|
333
|
+
continue
|
|
330
334
|
seen_vehicle_vins.add(vehicle_dict['vin'])
|
|
331
335
|
vehicle: Optional[SkodaVehicle] = garage.get_vehicle(vehicle_dict['vin']) # pyright: ignore[reportAssignmentType]
|
|
332
336
|
if not vehicle:
|
|
@@ -373,8 +377,9 @@ class Connector(BaseConnector):
|
|
|
373
377
|
vehicle_to_update: Optional[GenericVehicle] = garage.get_vehicle(vin)
|
|
374
378
|
if vehicle_to_update is not None and isinstance(vehicle_to_update, SkodaVehicle) and vehicle_to_update.is_managed_by_connector(self):
|
|
375
379
|
vehicle_to_update = self.fetch_vehicle_status(vehicle_to_update)
|
|
376
|
-
vehicle_to_update = self.fetch_driving_range(vehicle_to_update)
|
|
377
380
|
if vehicle_to_update.capabilities is not None and vehicle_to_update.capabilities.enabled:
|
|
381
|
+
if vehicle_to_update.capabilities.has_capability('MEASUREMENTS', check_status_ok=True):
|
|
382
|
+
vehicle_to_update = self.fetch_driving_range(vehicle_to_update)
|
|
378
383
|
if vehicle_to_update.capabilities.has_capability('READINESS', check_status_ok=True):
|
|
379
384
|
vehicle_to_update = self.fetch_connection_status(vehicle_to_update)
|
|
380
385
|
if vehicle_to_update.capabilities.has_capability('PARKING_POSITION', check_status_ok=True):
|
|
@@ -509,14 +514,24 @@ class Connector(BaseConnector):
|
|
|
509
514
|
if 'settings' in data and data['settings'] is not None:
|
|
510
515
|
if 'targetStateOfChargeInPercent' in data['settings'] and data['settings']['targetStateOfChargeInPercent'] is not None \
|
|
511
516
|
and vehicle.charging is not None and vehicle.charging.settings is not None:
|
|
517
|
+
vehicle.charging.settings.target_level.minimum = 50.0
|
|
518
|
+
vehicle.charging.settings.target_level.maximum = 100.0
|
|
519
|
+
vehicle.charging.settings.target_level.precision = 10.0
|
|
520
|
+
vehicle.charging.settings.target_level._add_on_set_hook(self.__on_charging_target_level_change) # pylint: disable=protected-access
|
|
521
|
+
vehicle.charging.settings.target_level._is_changeable = True # pylint: disable=protected-access
|
|
512
522
|
# pylint: disable-next=protected-access
|
|
513
523
|
vehicle.charging.settings.target_level._set_value(value=data['settings']['targetStateOfChargeInPercent'], measured=captured_at)
|
|
514
524
|
else:
|
|
515
525
|
vehicle.charging.settings.target_level._set_value(None, measured=captured_at) # pylint: disable=protected-access
|
|
516
526
|
if 'maxChargeCurrentAc' in data['settings'] and data['settings']['maxChargeCurrentAc'] is not None \
|
|
517
527
|
and vehicle.charging is not None and vehicle.charging.settings is not None:
|
|
528
|
+
vehicle.charging.settings.maximum_current.minimum = 6.0
|
|
529
|
+
vehicle.charging.settings.maximum_current.maximum = 16.0
|
|
530
|
+
vehicle.charging.settings.maximum_current.precision = 1.0
|
|
531
|
+
vehicle.charging.settings.maximum_current._add_on_set_hook(self.__on_charging_maximum_current_change) # pylint: disable=protected-access
|
|
532
|
+
vehicle.charging.settings.maximum_current._is_changeable = True # pylint: disable=protected-access
|
|
518
533
|
if data['settings']['maxChargeCurrentAc'] == 'MAXIMUM':
|
|
519
|
-
vehicle.charging.settings.maximum_current._set_value(value=
|
|
534
|
+
vehicle.charging.settings.maximum_current._set_value(value=16, measured=captured_at) # pylint: disable=protected-access
|
|
520
535
|
elif data['settings']['maxChargeCurrentAc'] == 'REDUCED':
|
|
521
536
|
vehicle.charging.settings.maximum_current._set_value(value=6, measured=captured_at) # pylint: disable=protected-access
|
|
522
537
|
else:
|
|
@@ -525,6 +540,8 @@ class Connector(BaseConnector):
|
|
|
525
540
|
else:
|
|
526
541
|
vehicle.charging.settings.maximum_current._set_value(None, measured=captured_at) # pylint: disable=protected-access
|
|
527
542
|
if 'autoUnlockPlugWhenCharged' in data['settings'] and data['settings']['autoUnlockPlugWhenCharged'] is not None:
|
|
543
|
+
vehicle.charging.settings.auto_unlock._add_on_set_hook(self.__on_charging_auto_unlock_change) # pylint: disable=protected-access
|
|
544
|
+
vehicle.charging.settings.auto_unlock._is_changeable = True # pylint: disable=protected-access
|
|
528
545
|
if data['settings']['autoUnlockPlugWhenCharged'] in ['ON', 'PERMANENT']:
|
|
529
546
|
vehicle.charging.settings.auto_unlock._set_value(True, measured=captured_at) # pylint: disable=protected-access
|
|
530
547
|
elif data['settings']['autoUnlockPlugWhenCharged'] == 'OFF':
|
|
@@ -1234,7 +1251,7 @@ class Connector(BaseConnector):
|
|
|
1234
1251
|
car_type = GenericVehicle.Type(range_data['carType'])
|
|
1235
1252
|
if car_type == GenericVehicle.Type.ELECTRIC and not isinstance(vehicle, SkodaElectricVehicle):
|
|
1236
1253
|
LOG.debug('Promoting %s to SkodaElectricVehicle object for %s', vehicle.__class__.__name__, vin)
|
|
1237
|
-
vehicle = SkodaElectricVehicle(origin=vehicle)
|
|
1254
|
+
vehicle = SkodaElectricVehicle(garage=self.car_connectivity.garage, origin=vehicle)
|
|
1238
1255
|
self.car_connectivity.garage.replace_vehicle(vin, vehicle)
|
|
1239
1256
|
elif car_type in [GenericVehicle.Type.FUEL,
|
|
1240
1257
|
GenericVehicle.Type.GASOLINE,
|
|
@@ -1244,11 +1261,11 @@ class Connector(BaseConnector):
|
|
|
1244
1261
|
GenericVehicle.Type.LPG] \
|
|
1245
1262
|
and not isinstance(vehicle, SkodaCombustionVehicle):
|
|
1246
1263
|
LOG.debug('Promoting %s to SkodaCombustionVehicle object for %s', vehicle.__class__.__name__, vin)
|
|
1247
|
-
vehicle = SkodaCombustionVehicle(origin=vehicle)
|
|
1264
|
+
vehicle = SkodaCombustionVehicle(garage=self.car_connectivity.garage, origin=vehicle)
|
|
1248
1265
|
self.car_connectivity.garage.replace_vehicle(vin, vehicle)
|
|
1249
1266
|
elif car_type == GenericVehicle.Type.HYBRID and not isinstance(vehicle, SkodaHybridVehicle):
|
|
1250
1267
|
LOG.debug('Promoting %s to SkodaHybridVehicle object for %s', vehicle.__class__.__name__, vin)
|
|
1251
|
-
vehicle = SkodaHybridVehicle(origin=vehicle)
|
|
1268
|
+
vehicle = SkodaHybridVehicle(garage=self.car_connectivity.garage, origin=vehicle)
|
|
1252
1269
|
self.car_connectivity.garage.replace_vehicle(vin, vehicle)
|
|
1253
1270
|
except ValueError:
|
|
1254
1271
|
LOG_API.warning('Unknown car type %s', range_data['carType'])
|
|
@@ -1889,5 +1906,122 @@ class Connector(BaseConnector):
|
|
|
1889
1906
|
raise CommandError(f'Retrying failed: {retry_error}') from retry_error
|
|
1890
1907
|
return command_arguments
|
|
1891
1908
|
|
|
1909
|
+
def __on_charging_target_level_change(self, level_attribute: LevelAttribute, target_level: float) -> float:
|
|
1910
|
+
"""
|
|
1911
|
+
Callback for the charging target level change.
|
|
1912
|
+
|
|
1913
|
+
Args:
|
|
1914
|
+
level_attribute (LevelAttribute): The level attribute that changed.
|
|
1915
|
+
target_level (float): The new target level.
|
|
1916
|
+
"""
|
|
1917
|
+
if level_attribute.parent is None or level_attribute.parent.parent is None \
|
|
1918
|
+
or level_attribute.parent.parent.parent is None or not isinstance(level_attribute.parent.parent.parent, SkodaVehicle):
|
|
1919
|
+
raise SetterError('Object hierarchy is not as expected')
|
|
1920
|
+
vehicle: SkodaVehicle = level_attribute.parent.parent.parent
|
|
1921
|
+
vin: Optional[str] = vehicle.vin.value
|
|
1922
|
+
if vin is None:
|
|
1923
|
+
raise SetterError('VIN in object hierarchy missing')
|
|
1924
|
+
precision: float = level_attribute.precision if level_attribute.precision is not None else 10.0
|
|
1925
|
+
target_level = round(target_level / precision) * precision
|
|
1926
|
+
setting_dict = {}
|
|
1927
|
+
setting_dict['targetSOCInPercent'] = target_level
|
|
1928
|
+
|
|
1929
|
+
url = f'https://mysmob.api.connect.skoda-auto.cz/api/v1/charging/{vin}/set-charge-limit'
|
|
1930
|
+
try:
|
|
1931
|
+
settings_response: requests.Response = self.session.put(url, data=json.dumps(setting_dict), allow_redirects=True)
|
|
1932
|
+
if settings_response.status_code != requests.codes['accepted']:
|
|
1933
|
+
LOG.error('Could not set target level (%s)', settings_response.status_code)
|
|
1934
|
+
raise SetterError(f'Could not set value ({settings_response.status_code})')
|
|
1935
|
+
except requests.exceptions.ConnectionError as connection_error:
|
|
1936
|
+
raise SetterError(f'Connection error: {connection_error}.'
|
|
1937
|
+
' If this happens frequently, please check if other applications communicate with the Skoda server.') from connection_error
|
|
1938
|
+
except requests.exceptions.ChunkedEncodingError as chunked_encoding_error:
|
|
1939
|
+
raise SetterError(f'Error: {chunked_encoding_error}') from chunked_encoding_error
|
|
1940
|
+
except requests.exceptions.ReadTimeout as timeout_error:
|
|
1941
|
+
raise SetterError(f'Timeout during read: {timeout_error}') from timeout_error
|
|
1942
|
+
except requests.exceptions.RetryError as retry_error:
|
|
1943
|
+
raise SetterError(f'Retrying failed: {retry_error}') from retry_error
|
|
1944
|
+
return target_level
|
|
1945
|
+
|
|
1946
|
+
def __on_charging_maximum_current_change(self, current_attribute: CurrentAttribute, maximum_current: float) -> float:
|
|
1947
|
+
"""
|
|
1948
|
+
Callback for the charging target level change.
|
|
1949
|
+
|
|
1950
|
+
Args:
|
|
1951
|
+
current_attribute (CurrentAttribute): The current attribute that changed.
|
|
1952
|
+
maximum_current (float): The new maximum current.
|
|
1953
|
+
"""
|
|
1954
|
+
if current_attribute.parent is None or current_attribute.parent.parent is None \
|
|
1955
|
+
or current_attribute.parent.parent.parent is None or not isinstance(current_attribute.parent.parent.parent, SkodaVehicle):
|
|
1956
|
+
raise SetterError('Object hierarchy is not as expected')
|
|
1957
|
+
vehicle: SkodaVehicle = current_attribute.parent.parent.parent
|
|
1958
|
+
vin: Optional[str] = vehicle.vin.value
|
|
1959
|
+
if vin is None:
|
|
1960
|
+
raise SetterError('VIN in object hierarchy missing')
|
|
1961
|
+
setting_dict = {}
|
|
1962
|
+
precision: float = current_attribute.precision if current_attribute.precision is not None else 1.0
|
|
1963
|
+
maximum_current = round(maximum_current / precision) * precision
|
|
1964
|
+
if maximum_current < 16:
|
|
1965
|
+
setting_dict['chargingCurrent'] = "REDUCED"
|
|
1966
|
+
maximum_current = 6.0
|
|
1967
|
+
else:
|
|
1968
|
+
setting_dict['chargingCurrent'] = "MAXIMUM"
|
|
1969
|
+
maximum_current = 16.0
|
|
1970
|
+
|
|
1971
|
+
url = f'https://mysmob.api.connect.skoda-auto.cz/api/v1/charging/{vin}/set-charging-current'
|
|
1972
|
+
try:
|
|
1973
|
+
settings_response: requests.Response = self.session.put(url, data=json.dumps(setting_dict), allow_redirects=True)
|
|
1974
|
+
if settings_response.status_code != requests.codes['accepted']:
|
|
1975
|
+
LOG.error('Could not set target charging current (%s)', settings_response.status_code)
|
|
1976
|
+
raise SetterError(f'Could not set value ({settings_response.status_code})')
|
|
1977
|
+
except requests.exceptions.ConnectionError as connection_error:
|
|
1978
|
+
raise SetterError(f'Connection error: {connection_error}.'
|
|
1979
|
+
' If this happens frequently, please check if other applications communicate with the Skoda server.') from connection_error
|
|
1980
|
+
except requests.exceptions.ChunkedEncodingError as chunked_encoding_error:
|
|
1981
|
+
raise SetterError(f'Error: {chunked_encoding_error}') from chunked_encoding_error
|
|
1982
|
+
except requests.exceptions.ReadTimeout as timeout_error:
|
|
1983
|
+
raise SetterError(f'Timeout during read: {timeout_error}') from timeout_error
|
|
1984
|
+
except requests.exceptions.RetryError as retry_error:
|
|
1985
|
+
raise SetterError(f'Retrying failed: {retry_error}') from retry_error
|
|
1986
|
+
return maximum_current
|
|
1987
|
+
|
|
1988
|
+
def __on_charging_auto_unlock_change(self, boolean_attribute: BooleanAttribute, auto_unlock: bool) -> bool:
|
|
1989
|
+
"""
|
|
1990
|
+
Callback for the charging target level change.
|
|
1991
|
+
|
|
1992
|
+
Args:
|
|
1993
|
+
boolean_attribute (BooleanAttribute): The boolean attribute that changed.
|
|
1994
|
+
auto_unlock (float): The new auto_unlock setting.
|
|
1995
|
+
"""
|
|
1996
|
+
if boolean_attribute.parent is None or boolean_attribute.parent.parent is None \
|
|
1997
|
+
or boolean_attribute.parent.parent.parent is None or not isinstance(boolean_attribute.parent.parent.parent, SkodaVehicle):
|
|
1998
|
+
raise SetterError('Object hierarchy is not as expected')
|
|
1999
|
+
vehicle: SkodaVehicle = boolean_attribute.parent.parent.parent
|
|
2000
|
+
vin: Optional[str] = vehicle.vin.value
|
|
2001
|
+
if vin is None:
|
|
2002
|
+
raise SetterError('VIN in object hierarchy missing')
|
|
2003
|
+
setting_dict = {}
|
|
2004
|
+
if auto_unlock:
|
|
2005
|
+
setting_dict['autoUnlockPlug'] = "PERMANENT"
|
|
2006
|
+
else:
|
|
2007
|
+
setting_dict['autoUnlockPlug'] = "OFF"
|
|
2008
|
+
|
|
2009
|
+
url = f'https://mysmob.api.connect.skoda-auto.cz/api/v1/charging/{vin}/set-auto-unlock-plug'
|
|
2010
|
+
try:
|
|
2011
|
+
settings_response: requests.Response = self.session.put(url, data=json.dumps(setting_dict), allow_redirects=True)
|
|
2012
|
+
if settings_response.status_code != requests.codes['accepted']:
|
|
2013
|
+
LOG.error('Could not set auto unlock setting (%s)', settings_response.status_code)
|
|
2014
|
+
raise SetterError(f'Could not set value ({settings_response.status_code})')
|
|
2015
|
+
except requests.exceptions.ConnectionError as connection_error:
|
|
2016
|
+
raise SetterError(f'Connection error: {connection_error}.'
|
|
2017
|
+
' If this happens frequently, please check if other applications communicate with the Skoda server.') from connection_error
|
|
2018
|
+
except requests.exceptions.ChunkedEncodingError as chunked_encoding_error:
|
|
2019
|
+
raise SetterError(f'Error: {chunked_encoding_error}') from chunked_encoding_error
|
|
2020
|
+
except requests.exceptions.ReadTimeout as timeout_error:
|
|
2021
|
+
raise SetterError(f'Timeout during read: {timeout_error}') from timeout_error
|
|
2022
|
+
except requests.exceptions.RetryError as retry_error:
|
|
2023
|
+
raise SetterError(f'Retrying failed: {retry_error}') from retry_error
|
|
2024
|
+
return auto_unlock
|
|
2025
|
+
|
|
1892
2026
|
def get_name(self) -> str:
|
|
1893
2027
|
return "Skoda Connector"
|
|
@@ -19,8 +19,8 @@ class ConnectorUI(BaseConnectorUI):
|
|
|
19
19
|
A user interface class for the Skoda connector in the Car Connectivity application.
|
|
20
20
|
"""
|
|
21
21
|
def __init__(self, connector: BaseConnector):
|
|
22
|
-
blueprint: Optional[flask.Blueprint] = flask.Blueprint(name=
|
|
23
|
-
|
|
22
|
+
blueprint: Optional[flask.Blueprint] = flask.Blueprint(name=connector.id, import_name='carconnectivity-connector-skoda', url_prefix=f'/{connector.id}',
|
|
23
|
+
template_folder=os.path.dirname(__file__) + '/templates')
|
|
24
24
|
super().__init__(connector, blueprint=blueprint)
|
|
25
25
|
|
|
26
26
|
def get_nav_items(self) -> List[Dict[Literal['text', 'url', 'sublinks', 'divider'], Union[str, List]]]:
|
|
@@ -30,7 +30,7 @@ class SkodaVehicle(GenericVehicle): # pylint: disable=too-many-instance-attribu
|
|
|
30
30
|
def __init__(self, vin: Optional[str] = None, garage: Optional[Garage] = None, managing_connector: Optional[BaseConnector] = None,
|
|
31
31
|
origin: Optional[SkodaVehicle] = None) -> None:
|
|
32
32
|
if origin is not None:
|
|
33
|
-
super().__init__(origin=origin)
|
|
33
|
+
super().__init__(garage=garage, origin=origin)
|
|
34
34
|
self.capabilities: Capabilities = origin.capabilities
|
|
35
35
|
self.capabilities.parent = self
|
|
36
36
|
self.in_motion: BooleanAttribute = origin.in_motion
|
|
@@ -55,13 +55,14 @@ class SkodaElectricVehicle(ElectricVehicle, SkodaVehicle):
|
|
|
55
55
|
def __init__(self, vin: Optional[str] = None, garage: Optional[Garage] = None, managing_connector: Optional[BaseConnector] = None,
|
|
56
56
|
origin: Optional[SkodaVehicle] = None) -> None:
|
|
57
57
|
if origin is not None:
|
|
58
|
-
super().__init__(origin=origin)
|
|
58
|
+
super().__init__(garage=garage, origin=origin)
|
|
59
59
|
if isinstance(origin, ElectricVehicle):
|
|
60
|
-
self.charging: Charging = SkodaCharging(origin=origin.charging)
|
|
61
|
-
|
|
60
|
+
self.charging: Charging = SkodaCharging(vehicle=self, origin=origin.charging)
|
|
61
|
+
else:
|
|
62
|
+
self.charging: Charging = SkodaCharging(vehicle=self, origin=self.charging)
|
|
62
63
|
else:
|
|
63
64
|
super().__init__(vin=vin, garage=garage, managing_connector=managing_connector)
|
|
64
|
-
self.charging: Charging = SkodaCharging(vehicle=self)
|
|
65
|
+
self.charging: Charging = SkodaCharging(vehicle=self, origin=self.charging)
|
|
65
66
|
|
|
66
67
|
|
|
67
68
|
class SkodaCombustionVehicle(CombustionVehicle, SkodaVehicle):
|
|
@@ -71,7 +72,7 @@ class SkodaCombustionVehicle(CombustionVehicle, SkodaVehicle):
|
|
|
71
72
|
def __init__(self, vin: Optional[str] = None, garage: Optional[Garage] = None, managing_connector: Optional[BaseConnector] = None,
|
|
72
73
|
origin: Optional[SkodaVehicle] = None) -> None:
|
|
73
74
|
if origin is not None:
|
|
74
|
-
super().__init__(origin=origin)
|
|
75
|
+
super().__init__(garage=garage, origin=origin)
|
|
75
76
|
else:
|
|
76
77
|
super().__init__(vin=vin, garage=garage, managing_connector=managing_connector)
|
|
77
78
|
|
|
@@ -83,6 +84,6 @@ class SkodaHybridVehicle(HybridVehicle, SkodaVehicle):
|
|
|
83
84
|
def __init__(self, vin: Optional[str] = None, garage: Optional[Garage] = None, managing_connector: Optional[BaseConnector] = None,
|
|
84
85
|
origin: Optional[SkodaVehicle] = None) -> None:
|
|
85
86
|
if origin is not None:
|
|
86
|
-
super().__init__(origin=origin)
|
|
87
|
+
super().__init__(garage=garage, origin=origin)
|
|
87
88
|
else:
|
|
88
89
|
super().__init__(vin=vin, garage=garage, managing_connector=managing_connector)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{carconnectivity_connector_skoda-0.5a1 → carconnectivity_connector_skoda-0.6}/.github/dependabot.yml
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|