carconnectivity-connector-skoda 0.4a8__tar.gz → 0.5a1__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/CHANGELOG.md +45 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/PKG-INFO +3 -3
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/README.md +1 -1
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/pyproject.toml +1 -1
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connector_skoda.egg-info/PKG-INFO +3 -3
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connector_skoda.egg-info/requires.txt +1 -1
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/_version.py +2 -2
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/capability.py +11 -4
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/connector.py +110 -12
- carconnectivity_connector_skoda-0.4a8/CHANGELOG.md +0 -25
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/.flake8 +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/.github/dependabot.yml +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/.github/workflows/build.yml +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/.github/workflows/build_and_publish.yml +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/.github/workflows/codeql-analysis.yml +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/.gitignore +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/LICENSE +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/Makefile +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/doc/Config.md +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/setup.cfg +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/setup_requirements.txt +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connector_skoda.egg-info/SOURCES.txt +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connector_skoda.egg-info/dependency_links.txt +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connector_skoda.egg-info/top_level.txt +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/__init__.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/auth/__init__.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/auth/auth_util.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/auth/helpers/blacklist_retry.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/auth/my_skoda_session.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/auth/openid_session.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/auth/session_manager.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/auth/skoda_web_session.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/charging.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/climatization.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/command_impl.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/error.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/mqtt_client.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/ui/connector_ui.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/src/carconnectivity_connectors/skoda/vehicle.py +0 -0
- {carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/test/integration_test/carConnectivity.json +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
- No unreleased changes so far
|
|
7
|
+
|
|
8
|
+
## [0.4.1] - 2025-03-04
|
|
9
|
+
### Fixed
|
|
10
|
+
- Fixed potential http error when parking position was fetched but due to error not available
|
|
11
|
+
|
|
12
|
+
## [0.4] - 2025-03-02
|
|
13
|
+
### Added
|
|
14
|
+
- Added better feedback when consent is needed
|
|
15
|
+
- added better access to connection state
|
|
16
|
+
- added better access to health state
|
|
17
|
+
- added attribute for vehicle in_motion
|
|
18
|
+
- added possibility to online change interval
|
|
19
|
+
- added named threads for better debugging
|
|
20
|
+
- added vehcile connection state
|
|
21
|
+
- added global vehicle state
|
|
22
|
+
- added maintainance objects
|
|
23
|
+
- added checks for min/max values with climatization temperatures
|
|
24
|
+
- improved error handling with commands
|
|
25
|
+
|
|
26
|
+
## [0.3] - 2025-02-19
|
|
27
|
+
### Added
|
|
28
|
+
- Added support for images
|
|
29
|
+
- Added tags to attributes
|
|
30
|
+
- Added support for webui via carconnectivity-plugin-webui
|
|
31
|
+
|
|
32
|
+
## [0.2] - 2025-02-02
|
|
33
|
+
### Added
|
|
34
|
+
- Wake Sleep command
|
|
35
|
+
|
|
36
|
+
## [0.1] - 2025-01-25
|
|
37
|
+
Initial release, let's go and give this to the public to try out...
|
|
38
|
+
The API is not yet implemented completely but most functions already work
|
|
39
|
+
|
|
40
|
+
[unreleased]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/compare/v0.4.1...HEAD
|
|
41
|
+
[0.4.1]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.4.1
|
|
42
|
+
[0.4]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.4
|
|
43
|
+
[0.3]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.3
|
|
44
|
+
[0.2]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.2
|
|
45
|
+
[0.1]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: carconnectivity-connector-skoda
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5a1
|
|
4
4
|
Summary: CarConnectivity connector for Skoda 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.8
|
|
38
38
|
Description-Content-Type: text/markdown
|
|
39
39
|
License-File: LICENSE
|
|
40
|
-
Requires-Dist: carconnectivity>=0.
|
|
40
|
+
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
|
|
@@ -45,7 +45,7 @@ Requires-Dist: paho-mqtt~=2.1.0
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
# CarConnectivity Connector for
|
|
48
|
+
# CarConnectivity Connector for Skoda Vehicles
|
|
49
49
|
[](https://github.com/tillsteinbach/CarConnectivity-connector-skoda/)
|
|
50
50
|
[](https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/latest)
|
|
51
51
|
[](https://github.com/tillsteinbach/CarConnectivity-connector-skoda/blob/master/LICENSE)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
# CarConnectivity Connector for
|
|
3
|
+
# CarConnectivity Connector for Skoda Vehicles
|
|
4
4
|
[](https://github.com/tillsteinbach/CarConnectivity-connector-skoda/)
|
|
5
5
|
[](https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/latest)
|
|
6
6
|
[](https://github.com/tillsteinbach/CarConnectivity-connector-skoda/blob/master/LICENSE)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: carconnectivity-connector-skoda
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5a1
|
|
4
4
|
Summary: CarConnectivity connector for Skoda 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.8
|
|
38
38
|
Description-Content-Type: text/markdown
|
|
39
39
|
License-File: LICENSE
|
|
40
|
-
Requires-Dist: carconnectivity>=0.
|
|
40
|
+
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
|
|
@@ -45,7 +45,7 @@ Requires-Dist: paho-mqtt~=2.1.0
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
# CarConnectivity Connector for
|
|
48
|
+
# CarConnectivity Connector for Skoda Vehicles
|
|
49
49
|
[](https://github.com/tillsteinbach/CarConnectivity-connector-skoda/)
|
|
50
50
|
[](https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/latest)
|
|
51
51
|
[](https://github.com/tillsteinbach/CarConnectivity-connector-skoda/blob/master/LICENSE)
|
|
@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING
|
|
|
5
5
|
from enum import IntEnum
|
|
6
6
|
|
|
7
7
|
from carconnectivity.objects import GenericObject
|
|
8
|
-
from carconnectivity.attributes import StringAttribute
|
|
8
|
+
from carconnectivity.attributes import StringAttribute, GenericAttribute
|
|
9
9
|
|
|
10
10
|
if TYPE_CHECKING:
|
|
11
11
|
from typing import Dict, Optional
|
|
@@ -77,7 +77,7 @@ class Capabilities(GenericObject):
|
|
|
77
77
|
"""
|
|
78
78
|
return self.__capabilities.get(capability_id)
|
|
79
79
|
|
|
80
|
-
def has_capability(self, capability_id: str) -> bool:
|
|
80
|
+
def has_capability(self, capability_id: str, check_status_ok=False) -> bool:
|
|
81
81
|
"""
|
|
82
82
|
Check if the Capabilities contains a capability with the specified ID.
|
|
83
83
|
|
|
@@ -87,7 +87,14 @@ class Capabilities(GenericObject):
|
|
|
87
87
|
Returns:
|
|
88
88
|
bool: True if the capability exists, otherwise False.
|
|
89
89
|
"""
|
|
90
|
-
|
|
90
|
+
if check_status_ok:
|
|
91
|
+
if capability_id in self.__capabilities and self.__capabilities[capability_id].enabled:
|
|
92
|
+
capability: Capability = self.__capabilities[capability_id]
|
|
93
|
+
if capability.status.enabled and capability.status.value is not None and len(capability.status.value) > 0:
|
|
94
|
+
return False
|
|
95
|
+
return True
|
|
96
|
+
return False
|
|
97
|
+
return capability_id in self.__capabilities and self.__capabilities[capability_id].enabled
|
|
91
98
|
|
|
92
99
|
|
|
93
100
|
class Capability(GenericObject):
|
|
@@ -103,7 +110,7 @@ class Capability(GenericObject):
|
|
|
103
110
|
super().__init__(object_id=capability_id, parent=capabilities)
|
|
104
111
|
self.delay_notifications = True
|
|
105
112
|
self.capability_id = StringAttribute("id", self, capability_id, tags={'connector_custom'})
|
|
106
|
-
self.
|
|
113
|
+
self.status = GenericAttribute("status", self, value=[], tags={'connector_custom'})
|
|
107
114
|
self.enabled = True
|
|
108
115
|
self.delay_notifications = False
|
|
109
116
|
|
|
@@ -29,8 +29,10 @@ from carconnectivity.position import Position
|
|
|
29
29
|
from carconnectivity.climatization import Climatization
|
|
30
30
|
from carconnectivity.charging_connector import ChargingConnector
|
|
31
31
|
from carconnectivity.commands import Commands
|
|
32
|
-
from carconnectivity.command_impl import ClimatizationStartStopCommand, ChargingStartStopCommand, HonkAndFlashCommand, LockUnlockCommand, WakeSleepCommand
|
|
32
|
+
from carconnectivity.command_impl import ClimatizationStartStopCommand, ChargingStartStopCommand, HonkAndFlashCommand, LockUnlockCommand, WakeSleepCommand, \
|
|
33
|
+
WindowHeatingStartStopCommand
|
|
33
34
|
from carconnectivity.enums import ConnectionState
|
|
35
|
+
from carconnectivity.window_heating import WindowHeatings
|
|
34
36
|
|
|
35
37
|
from carconnectivity_connectors.base.connector import BaseConnector
|
|
36
38
|
from carconnectivity_connectors.skoda.auth.session_manager import SessionManager, SessionUser, Service
|
|
@@ -373,15 +375,15 @@ class Connector(BaseConnector):
|
|
|
373
375
|
vehicle_to_update = self.fetch_vehicle_status(vehicle_to_update)
|
|
374
376
|
vehicle_to_update = self.fetch_driving_range(vehicle_to_update)
|
|
375
377
|
if vehicle_to_update.capabilities is not None and vehicle_to_update.capabilities.enabled:
|
|
376
|
-
if vehicle_to_update.capabilities.has_capability('READINESS'):
|
|
378
|
+
if vehicle_to_update.capabilities.has_capability('READINESS', check_status_ok=True):
|
|
377
379
|
vehicle_to_update = self.fetch_connection_status(vehicle_to_update)
|
|
378
|
-
if vehicle_to_update.capabilities.has_capability('PARKING_POSITION'):
|
|
380
|
+
if vehicle_to_update.capabilities.has_capability('PARKING_POSITION', check_status_ok=True):
|
|
379
381
|
vehicle_to_update = self.fetch_position(vehicle_to_update)
|
|
380
|
-
if vehicle_to_update.capabilities.has_capability('CHARGING') and isinstance(vehicle_to_update, SkodaElectricVehicle):
|
|
382
|
+
if vehicle_to_update.capabilities.has_capability('CHARGING', check_status_ok=True) and isinstance(vehicle_to_update, SkodaElectricVehicle):
|
|
381
383
|
vehicle_to_update = self.fetch_charging(vehicle_to_update)
|
|
382
|
-
if vehicle_to_update.capabilities.has_capability('AIR_CONDITIONING'):
|
|
384
|
+
if vehicle_to_update.capabilities.has_capability('AIR_CONDITIONING', check_status_ok=True):
|
|
383
385
|
vehicle_to_update = self.fetch_air_conditioning(vehicle_to_update)
|
|
384
|
-
if vehicle_to_update.capabilities.has_capability('VEHICLE_HEALTH_INSPECTION'):
|
|
386
|
+
if vehicle_to_update.capabilities.has_capability('VEHICLE_HEALTH_INSPECTION', check_status_ok=True):
|
|
385
387
|
vehicle_to_update = self.fetch_maintenance(vehicle_to_update)
|
|
386
388
|
vehicle_to_update = self.decide_state(vehicle_to_update)
|
|
387
389
|
self.car_connectivity.transaction_end()
|
|
@@ -646,7 +648,7 @@ class Connector(BaseConnector):
|
|
|
646
648
|
vehicle.in_motion._set_value(data['inMotion']) # pylint: disable=protected-access
|
|
647
649
|
else:
|
|
648
650
|
vehicle.in_motion._set_value(None) # pylint: disable=protected-access
|
|
649
|
-
log_extra_keys(LOG_API, 'connection status', data, {'unreachable'})
|
|
651
|
+
log_extra_keys(LOG_API, 'connection status', data, {'unreachable', 'inMotion'})
|
|
650
652
|
return vehicle
|
|
651
653
|
|
|
652
654
|
def fetch_position(self, vehicle: SkodaVehicle, no_cache: bool = False) -> SkodaVehicle:
|
|
@@ -701,6 +703,10 @@ class Connector(BaseConnector):
|
|
|
701
703
|
vehicle.position.latitude._set_value(None) # pylint: disable=protected-access
|
|
702
704
|
vehicle.position.longitude._set_value(None) # pylint: disable=protected-access
|
|
703
705
|
vehicle.position.position_type._set_value(None) # pylint: disable=protected-access
|
|
706
|
+
else:
|
|
707
|
+
vehicle.position.latitude._set_value(None) # pylint: disable=protected-access
|
|
708
|
+
vehicle.position.longitude._set_value(None) # pylint: disable=protected-access
|
|
709
|
+
vehicle.position.position_type._set_value(None) # pylint: disable=protected-access
|
|
704
710
|
return vehicle
|
|
705
711
|
|
|
706
712
|
def fetch_maintenance(self, vehicle: SkodaVehicle, no_cache: bool = False) -> SkodaVehicle:
|
|
@@ -969,7 +975,44 @@ class Connector(BaseConnector):
|
|
|
969
975
|
# pylint: disable-next=protected-access
|
|
970
976
|
vehicle.charging.connector.lock_state._set_value(value=None, measured=captured_at)
|
|
971
977
|
if 'windowHeatingState' in data and data['windowHeatingState'] is not None:
|
|
972
|
-
|
|
978
|
+
heating_on: bool = False
|
|
979
|
+
all_heating_invalid: bool = True
|
|
980
|
+
for window_id, state in data['windowHeatingState'].items():
|
|
981
|
+
if window_id != 'unspecified':
|
|
982
|
+
if window_id in vehicle.window_heatings.windows:
|
|
983
|
+
window: WindowHeatings.WindowHeating = vehicle.window_heatings.windows[window_id]
|
|
984
|
+
else:
|
|
985
|
+
window = WindowHeatings.WindowHeating(window_id=window_id, window_heatings=vehicle.window_heatings)
|
|
986
|
+
vehicle.window_heatings.windows[window_id] = window
|
|
987
|
+
|
|
988
|
+
if state.lower() in [item.value for item in WindowHeatings.HeatingState]:
|
|
989
|
+
window_heating_state: WindowHeatings.HeatingState = WindowHeatings.HeatingState(state.lower())
|
|
990
|
+
if window_heating_state == WindowHeatings.HeatingState.ON:
|
|
991
|
+
heating_on = True
|
|
992
|
+
if window_heating_state in [WindowHeatings.HeatingState.ON,
|
|
993
|
+
WindowHeatings.HeatingState.OFF]:
|
|
994
|
+
all_heating_invalid = False
|
|
995
|
+
window.heating_state._set_value(window_heating_state, measured=captured_at) # pylint: disable=protected-access
|
|
996
|
+
else:
|
|
997
|
+
LOG_API.info('Unknown window heating state %s not in %s', state.lower(), str(WindowHeatings.HeatingState))
|
|
998
|
+
# pylint: disable-next=protected-access
|
|
999
|
+
window.heating_state._set_value(WindowHeatings.HeatingState.UNKNOWN, measured=captured_at)
|
|
1000
|
+
if all_heating_invalid:
|
|
1001
|
+
# pylint: disable-next=protected-access
|
|
1002
|
+
vehicle.window_heatings.heating_state._set_value(WindowHeatings.HeatingState.INVALID, measured=captured_at)
|
|
1003
|
+
else:
|
|
1004
|
+
if heating_on:
|
|
1005
|
+
# pylint: disable-next=protected-access
|
|
1006
|
+
vehicle.window_heatings.heating_state._set_value(WindowHeatings.HeatingState.ON, measured=captured_at)
|
|
1007
|
+
else:
|
|
1008
|
+
# pylint: disable-next=protected-access
|
|
1009
|
+
vehicle.window_heatings.heating_state._set_value(WindowHeatings.HeatingState.OFF, measured=captured_at)
|
|
1010
|
+
if vehicle.window_heatings is not None and vehicle.window_heatings.commands is not None \
|
|
1011
|
+
and not vehicle.window_heatings.commands.contains_command('start-stop'):
|
|
1012
|
+
start_stop_command = WindowHeatingStartStopCommand(parent=vehicle.window_heatings.commands)
|
|
1013
|
+
start_stop_command._add_on_set_hook(self.__on_window_heating_start_stop) # pylint: disable=protected-access
|
|
1014
|
+
start_stop_command.enabled = True
|
|
1015
|
+
vehicle.window_heatings.commands.add_command(start_stop_command)
|
|
973
1016
|
if 'errors' in data and data['errors'] is not None:
|
|
974
1017
|
found_errors: Set[str] = set()
|
|
975
1018
|
if not isinstance(vehicle.climatization, SkodaClimatization):
|
|
@@ -998,7 +1041,7 @@ class Connector(BaseConnector):
|
|
|
998
1041
|
log_extra_keys(LOG_API, 'air-condition', data, {'carCapturedTimestamp', 'state', 'estimatedDateTimeToReachTargetTemperature',
|
|
999
1042
|
'targetTemperature', 'outsideTemperature', 'chargerConnectionState',
|
|
1000
1043
|
'chargerLockState', 'airConditioningAtUnlock', 'steeringWheelPosition',
|
|
1001
|
-
'windowHeatingEnabled', 'seatHeatingActivated', 'errors'})
|
|
1044
|
+
'windowHeatingEnabled', 'seatHeatingActivated', 'windowHeatingState', 'errors'})
|
|
1002
1045
|
return vehicle
|
|
1003
1046
|
|
|
1004
1047
|
def fetch_vehicle_details(self, vehicle: SkodaVehicle, no_cache: bool = False) -> SkodaVehicle:
|
|
@@ -1034,6 +1077,20 @@ class Connector(BaseConnector):
|
|
|
1034
1077
|
else:
|
|
1035
1078
|
capability = Capability(capability_id=capability_id, capabilities=vehicle.capabilities)
|
|
1036
1079
|
vehicle.capabilities.add_capability(capability_id, capability)
|
|
1080
|
+
if 'statuses' in capability_dict and capability_dict['statuses'] is not None:
|
|
1081
|
+
statuses = capability_dict['statuses']
|
|
1082
|
+
if isinstance(statuses, list):
|
|
1083
|
+
for status in statuses:
|
|
1084
|
+
if status in [item.name for item in Capability.Status]:
|
|
1085
|
+
capability.status.value.append(Capability.Status[status])
|
|
1086
|
+
else:
|
|
1087
|
+
LOG_API.warning('Capability status unkown %s', status)
|
|
1088
|
+
capability.status.value.append(Capability.Status.UNKNOWN)
|
|
1089
|
+
else:
|
|
1090
|
+
LOG_API.warning('Capability status not a list in %s', statuses)
|
|
1091
|
+
else:
|
|
1092
|
+
capability.status.value.clear()
|
|
1093
|
+
log_extra_keys(LOG_API, 'capability', capability_dict, {'id', 'statuses'})
|
|
1037
1094
|
else:
|
|
1038
1095
|
raise APIError('Could not parse capability, id missing')
|
|
1039
1096
|
for capability_id in vehicle.capabilities.capabilities.keys() - found_capabilities:
|
|
@@ -1043,7 +1100,7 @@ class Connector(BaseConnector):
|
|
|
1043
1100
|
else:
|
|
1044
1101
|
vehicle.capabilities.clear_capabilities()
|
|
1045
1102
|
|
|
1046
|
-
if vehicle.capabilities.has_capability('VEHICLE_WAKE_UP_TRIGGER'):
|
|
1103
|
+
if vehicle.capabilities.has_capability('VEHICLE_WAKE_UP_TRIGGER', check_status_ok=True):
|
|
1047
1104
|
if vehicle.commands is not None and vehicle.commands.commands is not None \
|
|
1048
1105
|
and not vehicle.commands.contains_command('wake-sleep'):
|
|
1049
1106
|
wake_sleep_command = WakeSleepCommand(parent=vehicle.commands)
|
|
@@ -1052,7 +1109,8 @@ class Connector(BaseConnector):
|
|
|
1052
1109
|
vehicle.commands.add_command(wake_sleep_command)
|
|
1053
1110
|
|
|
1054
1111
|
# Add HONK_AND_FLASH command if necessary capabilities are available
|
|
1055
|
-
if vehicle.capabilities.has_capability('HONK_AND_FLASH')
|
|
1112
|
+
if vehicle.capabilities.has_capability('HONK_AND_FLASH', check_status_ok=True) \
|
|
1113
|
+
and vehicle.capabilities.has_capability('PARKING_POSITION', check_status_ok=True):
|
|
1056
1114
|
if vehicle.commands is not None and vehicle.commands.commands is not None \
|
|
1057
1115
|
and not vehicle.commands.contains_command('honk-flash'):
|
|
1058
1116
|
honk_flash_command = HonkAndFlashCommand(parent=vehicle.commands)
|
|
@@ -1061,7 +1119,7 @@ class Connector(BaseConnector):
|
|
|
1061
1119
|
vehicle.commands.add_command(honk_flash_command)
|
|
1062
1120
|
|
|
1063
1121
|
# Add lock and unlock command
|
|
1064
|
-
if vehicle.capabilities.has_capability('ACCESS'):
|
|
1122
|
+
if vehicle.capabilities.has_capability('ACCESS', check_status_ok=True):
|
|
1065
1123
|
if vehicle.doors is not None and vehicle.doors.commands is not None and vehicle.doors.commands.commands is not None \
|
|
1066
1124
|
and not vehicle.doors.commands.contains_command('lock-unlock'):
|
|
1067
1125
|
lock_unlock_command = LockUnlockCommand(parent=vehicle.doors.commands)
|
|
@@ -1167,6 +1225,8 @@ class Connector(BaseConnector):
|
|
|
1167
1225
|
url = f'https://mysmob.api.connect.skoda-auto.cz/api/v2/vehicle-status/{vin}/driving-range'
|
|
1168
1226
|
range_data: Dict[str, Any] | None = self._fetch_data(url=url, session=self.session, no_cache=no_cache)
|
|
1169
1227
|
if range_data:
|
|
1228
|
+
if 'carCapturedTimestamp' not in range_data or range_data['carCapturedTimestamp'] is None:
|
|
1229
|
+
raise APIError('Could not fetch driving range, carCapturedTimestamp missing')
|
|
1170
1230
|
captured_at: datetime = robust_time_parse(range_data['carCapturedTimestamp'])
|
|
1171
1231
|
# Check vehicle type and if it does not match the current vehicle type, create a new vehicle object using copy constructor
|
|
1172
1232
|
if 'carType' in range_data and range_data['carType'] is not None:
|
|
@@ -1791,5 +1851,43 @@ class Connector(BaseConnector):
|
|
|
1791
1851
|
raise CommandError(f'Retrying failed: {retry_error}') from retry_error
|
|
1792
1852
|
return command_arguments
|
|
1793
1853
|
|
|
1854
|
+
def __on_window_heating_start_stop(self, start_stop_command: WindowHeatingStartStopCommand, command_arguments: Union[str, Dict[str, Any]]) \
|
|
1855
|
+
-> Union[str, Dict[str, Any]]:
|
|
1856
|
+
if start_stop_command.parent is None or start_stop_command.parent.parent is None \
|
|
1857
|
+
or start_stop_command.parent.parent.parent is None or not isinstance(start_stop_command.parent.parent.parent, SkodaVehicle):
|
|
1858
|
+
raise CommandError('Object hierarchy is not as expected')
|
|
1859
|
+
if not isinstance(command_arguments, dict):
|
|
1860
|
+
raise CommandError('Command arguments are not a dictionary')
|
|
1861
|
+
vehicle: SkodaVehicle = start_stop_command.parent.parent.parent
|
|
1862
|
+
vin: Optional[str] = vehicle.vin.value
|
|
1863
|
+
if vin is None:
|
|
1864
|
+
raise CommandError('VIN in object hierarchy missing')
|
|
1865
|
+
if 'command' not in command_arguments:
|
|
1866
|
+
raise CommandError('Command argument missing')
|
|
1867
|
+
try:
|
|
1868
|
+
if command_arguments['command'] == WindowHeatingStartStopCommand.Command.START:
|
|
1869
|
+
url = f'https://mysmob.api.connect.skoda-auto.cz/api/v2/air-conditioning/{vin}/start-window-heating'
|
|
1870
|
+
command_response: requests.Response = self.session.post(url, allow_redirects=True)
|
|
1871
|
+
elif command_arguments['command'] == WindowHeatingStartStopCommand.Command.STOP:
|
|
1872
|
+
url = f'https://mysmob.api.connect.skoda-auto.cz/api/v2/air-conditioning/{vin}/stop-window-heating'
|
|
1873
|
+
|
|
1874
|
+
command_response: requests.Response = self.session.post(url, allow_redirects=True)
|
|
1875
|
+
else:
|
|
1876
|
+
raise CommandError(f'Unknown command {command_arguments["command"]}')
|
|
1877
|
+
|
|
1878
|
+
if command_response.status_code != requests.codes['accepted']:
|
|
1879
|
+
LOG.error('Could not start/stop window heating (%s: %s)', command_response.status_code, command_response.text)
|
|
1880
|
+
raise CommandError(f'Could not start/stop window heating ({command_response.status_code}: {command_response.text})')
|
|
1881
|
+
except requests.exceptions.ConnectionError as connection_error:
|
|
1882
|
+
raise CommandError(f'Connection error: {connection_error}.'
|
|
1883
|
+
' If this happens frequently, please check if other applications communicate with the Skoda server.') from connection_error
|
|
1884
|
+
except requests.exceptions.ChunkedEncodingError as chunked_encoding_error:
|
|
1885
|
+
raise CommandError(f'Error: {chunked_encoding_error}') from chunked_encoding_error
|
|
1886
|
+
except requests.exceptions.ReadTimeout as timeout_error:
|
|
1887
|
+
raise CommandError(f'Timeout during read: {timeout_error}') from timeout_error
|
|
1888
|
+
except requests.exceptions.RetryError as retry_error:
|
|
1889
|
+
raise CommandError(f'Retrying failed: {retry_error}') from retry_error
|
|
1890
|
+
return command_arguments
|
|
1891
|
+
|
|
1794
1892
|
def get_name(self) -> str:
|
|
1795
1893
|
return "Skoda Connector"
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## [Unreleased]
|
|
6
|
-
- No unreleased changes so far
|
|
7
|
-
|
|
8
|
-
## [0.3] - 2025-02-19
|
|
9
|
-
### Added
|
|
10
|
-
- Added support for images
|
|
11
|
-
- Added tags to attributes
|
|
12
|
-
- Added support for webui via carconnectivity-plugin-webui
|
|
13
|
-
|
|
14
|
-
## [0.2] - 2025-02-02
|
|
15
|
-
### Added
|
|
16
|
-
- Wake Sleep command
|
|
17
|
-
|
|
18
|
-
## [0.1] - 2025-01-25
|
|
19
|
-
Initial release, let's go and give this to the public to try out...
|
|
20
|
-
The API is not yet implemented completely but most functions already work
|
|
21
|
-
|
|
22
|
-
[unreleased]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/compare/v0.3...HEAD
|
|
23
|
-
[0.3]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.3
|
|
24
|
-
[0.2]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.2
|
|
25
|
-
[0.1]: https://github.com/tillsteinbach/CarConnectivity-connector-skoda/releases/tag/v0.1
|
|
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
|
{carconnectivity_connector_skoda-0.4a8 → carconnectivity_connector_skoda-0.5a1}/doc/Config.md
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
|