pycupra 0.1.12__tar.gz → 0.1.13__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.
- {pycupra-0.1.12 → pycupra-0.1.13}/.gitignore +10 -10
- pycupra-0.1.13/PKG-INFO +59 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/connection.py +3 -1
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/android_checkin_pb2.pyi +257 -257
- pycupra-0.1.13/pycupra.egg-info/PKG-INFO +59 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra.egg-info/SOURCES.txt +0 -2
- pycupra-0.1.13/pycupra.egg-info/top_level.txt +3 -0
- pycupra-0.1.13/pyproject.toml +23 -0
- pycupra-0.1.12/PKG-INFO +0 -13
- pycupra-0.1.12/pycupra/__version__.py +0 -6
- pycupra-0.1.12/pycupra.egg-info/PKG-INFO +0 -13
- pycupra-0.1.12/pycupra.egg-info/top_level.txt +0 -1
- pycupra-0.1.12/pyproject.toml +0 -16
- pycupra-0.1.12/requirements.txt +0 -6
- {pycupra-0.1.12 → pycupra-0.1.13}/LICENSE +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/README.md +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/example/PyCupra.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/__init__.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/const.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/dashboard.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/exceptions.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/__init__.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/android_checkin.proto +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/android_checkin_pb2.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/checkin.proto +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/checkin_pb2.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/checkin_pb2.pyi +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/const.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/fcmpushclient.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/fcmregister.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/mcs.proto +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/mcs_pb2.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/mcs_pb2.pyi +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/firebase_messaging/py.typed +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/utilities.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra/vehicle.py +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra.egg-info/dependency_links.txt +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra.egg-info/requires.txt +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/pycupra_credentials.json.demo +0 -0
- {pycupra-0.1.12 → pycupra-0.1.13}/setup.cfg +0 -0
@@ -1,10 +1,10 @@
|
|
1
|
-
|
2
|
-
.eggs/
|
3
|
-
*.egg-info/
|
4
|
-
build/
|
5
|
-
dist/
|
6
|
-
__pycache__/
|
7
|
-
*.json
|
8
|
-
*.txt
|
9
|
-
*.log
|
10
|
-
www/
|
1
|
+
|
2
|
+
.eggs/
|
3
|
+
*.egg-info/
|
4
|
+
build/
|
5
|
+
dist/
|
6
|
+
__pycache__/
|
7
|
+
*.json
|
8
|
+
*.txt
|
9
|
+
*.log
|
10
|
+
www/
|
pycupra-0.1.13/PKG-INFO
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: pycupra
|
3
|
+
Version: 0.1.13
|
4
|
+
Summary: A library to read and send vehicle data via Cupra/Seat portal using the same API calls as the MyCupra/MySeat mobile app.
|
5
|
+
License-Expression: Apache-2.0
|
6
|
+
Requires-Python: >=3.10
|
7
|
+
Description-Content-Type: text/markdown
|
8
|
+
License-File: LICENSE
|
9
|
+
Requires-Dist: aiohttp
|
10
|
+
Requires-Dist: beautifulsoup4
|
11
|
+
Requires-Dist: cryptography
|
12
|
+
Requires-Dist: lxml
|
13
|
+
Requires-Dist: PyJWT
|
14
|
+
Requires-Dist: xmltodict
|
15
|
+
Requires-Dist: pandas
|
16
|
+
Dynamic: license-file
|
17
|
+
|
18
|
+
# PyCupra
|
19
|
+
|
20
|
+
A library to read and send vehicle data via Cupra/Seat portal using the same API calls as the MyCupra/MySeat mobile app.
|
21
|
+
|
22
|
+
Fork of https://github.com/Farfar/seatconnect which in turn is a fork of:
|
23
|
+
Fork of https://github.com/lendy007/skodaconnect which in turn is a fork of:
|
24
|
+
https://github.com/robinostlund/volkswagencarnet
|
25
|
+
|
26
|
+
## Information
|
27
|
+
|
28
|
+
Retrieve statistics about your Cupra/Seat from the Cupra/Seat Connect online service
|
29
|
+
|
30
|
+
No licence, public domain, no guarantees, feel free to use for anything. Please contribute improvements/bugfixes etc.
|
31
|
+
|
32
|
+
## Breaking changes
|
33
|
+
|
34
|
+
- The method vehicle.update(updateType) supports 3 different update types:
|
35
|
+
- updateType=0: Small update (=only get_basiccardata() and get_statusreport are called). If the last full update is more than 1100 seconds ago, then a full update is performed.
|
36
|
+
- updateType=1: Full update (nearly all get-methods are called. The model images and the capabilitites are refreshed only every 2 hours.)
|
37
|
+
- updateType=2: Like updateType=0, but ignoring the nightly update reduction
|
38
|
+
|
39
|
+
- Nightly update reduction: If nightly reduction is activated and the current time is within the time frame between 22:00 and 05:00, then vehicle.update(0) performs a full update, if the last full update is more than 1700 seconds ago. If that's not the case, vehicle.update(0) does nothing.
|
40
|
+
|
41
|
+
- PyCupra can ask the Seat/Cupra portal to send push notifications to PyCupra if the charging status or the climatisation status has changed or when the API has finished a request like lock or unlock vehicle, start or stop charging or change departure timers or ....
|
42
|
+
|
43
|
+
## Thanks to
|
44
|
+
|
45
|
+
- [RobinostLund](https://github.com/robinostlund/volkswagencarnet) for initial project for Volkswagen Carnet I was able to fork
|
46
|
+
- [Farfar](https://github.com/Farfar) for modifications related to electric engines
|
47
|
+
- [tanelvakker](https://github.com/tanelvakker) for modifications related to correct SPIN handling for various actions and using correct URLs also for MY2021
|
48
|
+
- [sdb9696](https://github.com/sdb9696) for the firebase-messaging package that is used in PyCupra with only minor modifications
|
49
|
+
|
50
|
+
### Example
|
51
|
+
|
52
|
+
For an extensive example, please use the code found in example/PyCupra.py.
|
53
|
+
When logged in the library will automatically create a vehicle object for every car registered to the account. Initially no data is fetched at all. Use the doLogin method and it will signin with the credentials used for the class constructor. After a successful login, the tokens are stored in a json file. Later doLogin calls can use the token file instead of the credentials.
|
54
|
+
Method get_vehicles will fetch vehicle basic information and create Vehicle class objects for all associated vehicles in account.
|
55
|
+
To update all available data use the update_all method of the Connect class. This will call the update function for all registered vehicles, which in turn will fetch data from all available API endpoints.
|
56
|
+
|
57
|
+
The file *pycupra_credentials.json.demo* explains the data structure of the credentials file.
|
58
|
+
|
59
|
+
|
@@ -15,6 +15,7 @@ import string
|
|
15
15
|
import secrets
|
16
16
|
import xmltodict
|
17
17
|
from copy import deepcopy
|
18
|
+
import importlib.metadata
|
18
19
|
|
19
20
|
from PIL import Image
|
20
21
|
from io import BytesIO
|
@@ -26,7 +27,7 @@ from jwt.exceptions import ExpiredSignatureError
|
|
26
27
|
import aiohttp
|
27
28
|
from bs4 import BeautifulSoup
|
28
29
|
from base64 import b64decode, b64encode, urlsafe_b64decode, urlsafe_b64encode
|
29
|
-
from .__version__ import __version__ as lib_version
|
30
|
+
#from .__version__ import __version__ as lib_version
|
30
31
|
from .utilities import read_config, json_loads
|
31
32
|
from .vehicle import Vehicle
|
32
33
|
from .exceptions import (
|
@@ -102,6 +103,7 @@ from .const import (
|
|
102
103
|
)
|
103
104
|
|
104
105
|
version_info >= (3, 0) or exit('Python 3 required')
|
106
|
+
lib_version = importlib.metadata.version("pycupra")
|
105
107
|
|
106
108
|
_LOGGER = logging.getLogger(__name__)
|
107
109
|
BRAND_CUPRA = 'cupra'
|
@@ -1,257 +1,257 @@
|
|
1
|
-
"""
|
2
|
-
@generated by mypy-protobuf. Do not edit manually!
|
3
|
-
isort:skip_file
|
4
|
-
Copyright 2014 The Chromium Authors. All rights reserved.
|
5
|
-
Use of this source code is governed by a BSD-style license that can be
|
6
|
-
found in the LICENSE file.
|
7
|
-
|
8
|
-
Logging information for Android "checkin" events (automatic, periodic
|
9
|
-
requests made by Android devices to the server).
|
10
|
-
"""
|
11
|
-
|
12
|
-
import builtins
|
13
|
-
import google.protobuf.descriptor
|
14
|
-
import google.protobuf.internal.enum_type_wrapper
|
15
|
-
import google.protobuf.message
|
16
|
-
import sys
|
17
|
-
import typing
|
18
|
-
|
19
|
-
if sys.version_info >= (3, 10):
|
20
|
-
import typing as typing_extensions
|
21
|
-
else:
|
22
|
-
import typing_extensions
|
23
|
-
|
24
|
-
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
25
|
-
|
26
|
-
class _DeviceType:
|
27
|
-
ValueType = typing.NewType("ValueType", builtins.int)
|
28
|
-
V: typing_extensions.TypeAlias = ValueType
|
29
|
-
|
30
|
-
class _DeviceTypeEnumTypeWrapper(
|
31
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DeviceType.ValueType],
|
32
|
-
builtins.type,
|
33
|
-
):
|
34
|
-
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
35
|
-
DEVICE_ANDROID_OS: _DeviceType.ValueType # 1
|
36
|
-
"""Android Device"""
|
37
|
-
DEVICE_IOS_OS: _DeviceType.ValueType # 2
|
38
|
-
"""Apple IOS device"""
|
39
|
-
DEVICE_CHROME_BROWSER: _DeviceType.ValueType # 3
|
40
|
-
"""Chrome browser - Not Chrome OS. No hardware records."""
|
41
|
-
DEVICE_CHROME_OS: _DeviceType.ValueType # 4
|
42
|
-
"""Chrome OS"""
|
43
|
-
|
44
|
-
class DeviceType(_DeviceType, metaclass=_DeviceTypeEnumTypeWrapper):
|
45
|
-
"""enum values correspond to the type of device.
|
46
|
-
Used in the AndroidCheckinProto and Device proto.
|
47
|
-
"""
|
48
|
-
|
49
|
-
DEVICE_ANDROID_OS: DeviceType.ValueType # 1
|
50
|
-
"""Android Device"""
|
51
|
-
DEVICE_IOS_OS: DeviceType.ValueType # 2
|
52
|
-
"""Apple IOS device"""
|
53
|
-
DEVICE_CHROME_BROWSER: DeviceType.ValueType # 3
|
54
|
-
"""Chrome browser - Not Chrome OS. No hardware records."""
|
55
|
-
DEVICE_CHROME_OS: DeviceType.ValueType # 4
|
56
|
-
"""Chrome OS"""
|
57
|
-
global___DeviceType = DeviceType
|
58
|
-
|
59
|
-
@typing_extensions.final
|
60
|
-
class ChromeBuildProto(google.protobuf.message.Message):
|
61
|
-
"""Build characteristics unique to the Chrome browser, and Chrome OS"""
|
62
|
-
|
63
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
64
|
-
|
65
|
-
class _Platform:
|
66
|
-
ValueType = typing.NewType("ValueType", builtins.int)
|
67
|
-
V: typing_extensions.TypeAlias = ValueType
|
68
|
-
|
69
|
-
class _PlatformEnumTypeWrapper(
|
70
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
|
71
|
-
ChromeBuildProto._Platform.ValueType
|
72
|
-
],
|
73
|
-
builtins.type,
|
74
|
-
):
|
75
|
-
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
76
|
-
PLATFORM_WIN: ChromeBuildProto._Platform.ValueType # 1
|
77
|
-
PLATFORM_MAC: ChromeBuildProto._Platform.ValueType # 2
|
78
|
-
PLATFORM_LINUX: ChromeBuildProto._Platform.ValueType # 3
|
79
|
-
PLATFORM_CROS: ChromeBuildProto._Platform.ValueType # 4
|
80
|
-
PLATFORM_IOS: ChromeBuildProto._Platform.ValueType # 5
|
81
|
-
PLATFORM_ANDROID: ChromeBuildProto._Platform.ValueType # 6
|
82
|
-
"""Just a placeholder. Likely don't need it due to the presence of the
|
83
|
-
Android GCM on phone/tablet devices.
|
84
|
-
"""
|
85
|
-
|
86
|
-
class Platform(_Platform, metaclass=_PlatformEnumTypeWrapper): ...
|
87
|
-
PLATFORM_WIN: ChromeBuildProto.Platform.ValueType # 1
|
88
|
-
PLATFORM_MAC: ChromeBuildProto.Platform.ValueType # 2
|
89
|
-
PLATFORM_LINUX: ChromeBuildProto.Platform.ValueType # 3
|
90
|
-
PLATFORM_CROS: ChromeBuildProto.Platform.ValueType # 4
|
91
|
-
PLATFORM_IOS: ChromeBuildProto.Platform.ValueType # 5
|
92
|
-
PLATFORM_ANDROID: ChromeBuildProto.Platform.ValueType # 6
|
93
|
-
"""Just a placeholder. Likely don't need it due to the presence of the
|
94
|
-
Android GCM on phone/tablet devices.
|
95
|
-
"""
|
96
|
-
|
97
|
-
class _Channel:
|
98
|
-
ValueType = typing.NewType("ValueType", builtins.int)
|
99
|
-
V: typing_extensions.TypeAlias = ValueType
|
100
|
-
|
101
|
-
class _ChannelEnumTypeWrapper(
|
102
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
|
103
|
-
ChromeBuildProto._Channel.ValueType
|
104
|
-
],
|
105
|
-
builtins.type,
|
106
|
-
):
|
107
|
-
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
108
|
-
CHANNEL_STABLE: ChromeBuildProto._Channel.ValueType # 1
|
109
|
-
CHANNEL_BETA: ChromeBuildProto._Channel.ValueType # 2
|
110
|
-
CHANNEL_DEV: ChromeBuildProto._Channel.ValueType # 3
|
111
|
-
CHANNEL_CANARY: ChromeBuildProto._Channel.ValueType # 4
|
112
|
-
CHANNEL_UNKNOWN: ChromeBuildProto._Channel.ValueType # 5
|
113
|
-
"""for tip of tree or custom builds"""
|
114
|
-
|
115
|
-
class Channel(_Channel, metaclass=_ChannelEnumTypeWrapper): ...
|
116
|
-
CHANNEL_STABLE: ChromeBuildProto.Channel.ValueType # 1
|
117
|
-
CHANNEL_BETA: ChromeBuildProto.Channel.ValueType # 2
|
118
|
-
CHANNEL_DEV: ChromeBuildProto.Channel.ValueType # 3
|
119
|
-
CHANNEL_CANARY: ChromeBuildProto.Channel.ValueType # 4
|
120
|
-
CHANNEL_UNKNOWN: ChromeBuildProto.Channel.ValueType # 5
|
121
|
-
"""for tip of tree or custom builds"""
|
122
|
-
|
123
|
-
PLATFORM_FIELD_NUMBER: builtins.int
|
124
|
-
CHROME_VERSION_FIELD_NUMBER: builtins.int
|
125
|
-
CHANNEL_FIELD_NUMBER: builtins.int
|
126
|
-
platform: global___ChromeBuildProto.Platform.ValueType
|
127
|
-
"""The platform of the device."""
|
128
|
-
chrome_version: builtins.str
|
129
|
-
"""The Chrome instance's version."""
|
130
|
-
channel: global___ChromeBuildProto.Channel.ValueType
|
131
|
-
"""The Channel (build type) of Chrome."""
|
132
|
-
def __init__(
|
133
|
-
self,
|
134
|
-
*,
|
135
|
-
platform: global___ChromeBuildProto.Platform.ValueType | None = ...,
|
136
|
-
chrome_version: builtins.str | None = ...,
|
137
|
-
channel: global___ChromeBuildProto.Channel.ValueType | None = ...,
|
138
|
-
) -> None: ...
|
139
|
-
def HasField(
|
140
|
-
self,
|
141
|
-
field_name: typing_extensions.Literal[
|
142
|
-
"channel",
|
143
|
-
b"channel",
|
144
|
-
"chrome_version",
|
145
|
-
b"chrome_version",
|
146
|
-
"platform",
|
147
|
-
b"platform",
|
148
|
-
],
|
149
|
-
) -> builtins.bool: ...
|
150
|
-
def ClearField(
|
151
|
-
self,
|
152
|
-
field_name: typing_extensions.Literal[
|
153
|
-
"channel",
|
154
|
-
b"channel",
|
155
|
-
"chrome_version",
|
156
|
-
b"chrome_version",
|
157
|
-
"platform",
|
158
|
-
b"platform",
|
159
|
-
],
|
160
|
-
) -> None: ...
|
161
|
-
|
162
|
-
global___ChromeBuildProto = ChromeBuildProto
|
163
|
-
|
164
|
-
@typing_extensions.final
|
165
|
-
class AndroidCheckinProto(google.protobuf.message.Message):
|
166
|
-
"""Information sent by the device in a "checkin" request."""
|
167
|
-
|
168
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
169
|
-
|
170
|
-
LAST_CHECKIN_MSEC_FIELD_NUMBER: builtins.int
|
171
|
-
CELL_OPERATOR_FIELD_NUMBER: builtins.int
|
172
|
-
SIM_OPERATOR_FIELD_NUMBER: builtins.int
|
173
|
-
ROAMING_FIELD_NUMBER: builtins.int
|
174
|
-
USER_NUMBER_FIELD_NUMBER: builtins.int
|
175
|
-
TYPE_FIELD_NUMBER: builtins.int
|
176
|
-
CHROME_BUILD_FIELD_NUMBER: builtins.int
|
177
|
-
last_checkin_msec: builtins.int
|
178
|
-
"""Miliseconds since the Unix epoch of the device's last successful checkin."""
|
179
|
-
cell_operator: builtins.str
|
180
|
-
"""The current MCC+MNC of the mobile device's current cell."""
|
181
|
-
sim_operator: builtins.str
|
182
|
-
"""The MCC+MNC of the SIM card (different from operator if the
|
183
|
-
device is roaming, for instance).
|
184
|
-
"""
|
185
|
-
roaming: builtins.str
|
186
|
-
"""The device's current roaming state (reported starting in eclair builds).
|
187
|
-
Currently one of "{,not}mobile-{,not}roaming", if it is present at all.
|
188
|
-
"""
|
189
|
-
user_number: builtins.int
|
190
|
-
"""For devices supporting multiple user profiles (which may be
|
191
|
-
supported starting in jellybean), the ordinal number of the
|
192
|
-
profile that is checking in. This is 0 for the primary profile
|
193
|
-
(which can't be changed without wiping the device), and 1,2,3,...
|
194
|
-
for additional profiles (which can be added and deleted freely).
|
195
|
-
"""
|
196
|
-
type: global___DeviceType.ValueType
|
197
|
-
"""Class of device. Indicates the type of build proto
|
198
|
-
(IosBuildProto/ChromeBuildProto/AndroidBuildProto)
|
199
|
-
That is included in this proto
|
200
|
-
"""
|
201
|
-
@property
|
202
|
-
def chrome_build(self) -> global___ChromeBuildProto:
|
203
|
-
"""For devices running MCS on Chrome, build-specific characteristics
|
204
|
-
of the browser. There are no hardware aspects (except for ChromeOS).
|
205
|
-
This will only be populated for Chrome builds/ChromeOS devices
|
206
|
-
"""
|
207
|
-
def __init__(
|
208
|
-
self,
|
209
|
-
*,
|
210
|
-
last_checkin_msec: builtins.int | None = ...,
|
211
|
-
cell_operator: builtins.str | None = ...,
|
212
|
-
sim_operator: builtins.str | None = ...,
|
213
|
-
roaming: builtins.str | None = ...,
|
214
|
-
user_number: builtins.int | None = ...,
|
215
|
-
type: global___DeviceType.ValueType | None = ...,
|
216
|
-
chrome_build: global___ChromeBuildProto | None = ...,
|
217
|
-
) -> None: ...
|
218
|
-
def HasField(
|
219
|
-
self,
|
220
|
-
field_name: typing_extensions.Literal[
|
221
|
-
"cell_operator",
|
222
|
-
b"cell_operator",
|
223
|
-
"chrome_build",
|
224
|
-
b"chrome_build",
|
225
|
-
"last_checkin_msec",
|
226
|
-
b"last_checkin_msec",
|
227
|
-
"roaming",
|
228
|
-
b"roaming",
|
229
|
-
"sim_operator",
|
230
|
-
b"sim_operator",
|
231
|
-
"type",
|
232
|
-
b"type",
|
233
|
-
"user_number",
|
234
|
-
b"user_number",
|
235
|
-
],
|
236
|
-
) -> builtins.bool: ...
|
237
|
-
def ClearField(
|
238
|
-
self,
|
239
|
-
field_name: typing_extensions.Literal[
|
240
|
-
"cell_operator",
|
241
|
-
b"cell_operator",
|
242
|
-
"chrome_build",
|
243
|
-
b"chrome_build",
|
244
|
-
"last_checkin_msec",
|
245
|
-
b"last_checkin_msec",
|
246
|
-
"roaming",
|
247
|
-
b"roaming",
|
248
|
-
"sim_operator",
|
249
|
-
b"sim_operator",
|
250
|
-
"type",
|
251
|
-
b"type",
|
252
|
-
"user_number",
|
253
|
-
b"user_number",
|
254
|
-
],
|
255
|
-
) -> None: ...
|
256
|
-
|
257
|
-
global___AndroidCheckinProto = AndroidCheckinProto
|
1
|
+
"""
|
2
|
+
@generated by mypy-protobuf. Do not edit manually!
|
3
|
+
isort:skip_file
|
4
|
+
Copyright 2014 The Chromium Authors. All rights reserved.
|
5
|
+
Use of this source code is governed by a BSD-style license that can be
|
6
|
+
found in the LICENSE file.
|
7
|
+
|
8
|
+
Logging information for Android "checkin" events (automatic, periodic
|
9
|
+
requests made by Android devices to the server).
|
10
|
+
"""
|
11
|
+
|
12
|
+
import builtins
|
13
|
+
import google.protobuf.descriptor
|
14
|
+
import google.protobuf.internal.enum_type_wrapper
|
15
|
+
import google.protobuf.message
|
16
|
+
import sys
|
17
|
+
import typing
|
18
|
+
|
19
|
+
if sys.version_info >= (3, 10):
|
20
|
+
import typing as typing_extensions
|
21
|
+
else:
|
22
|
+
import typing_extensions
|
23
|
+
|
24
|
+
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
25
|
+
|
26
|
+
class _DeviceType:
|
27
|
+
ValueType = typing.NewType("ValueType", builtins.int)
|
28
|
+
V: typing_extensions.TypeAlias = ValueType
|
29
|
+
|
30
|
+
class _DeviceTypeEnumTypeWrapper(
|
31
|
+
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DeviceType.ValueType],
|
32
|
+
builtins.type,
|
33
|
+
):
|
34
|
+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
35
|
+
DEVICE_ANDROID_OS: _DeviceType.ValueType # 1
|
36
|
+
"""Android Device"""
|
37
|
+
DEVICE_IOS_OS: _DeviceType.ValueType # 2
|
38
|
+
"""Apple IOS device"""
|
39
|
+
DEVICE_CHROME_BROWSER: _DeviceType.ValueType # 3
|
40
|
+
"""Chrome browser - Not Chrome OS. No hardware records."""
|
41
|
+
DEVICE_CHROME_OS: _DeviceType.ValueType # 4
|
42
|
+
"""Chrome OS"""
|
43
|
+
|
44
|
+
class DeviceType(_DeviceType, metaclass=_DeviceTypeEnumTypeWrapper):
|
45
|
+
"""enum values correspond to the type of device.
|
46
|
+
Used in the AndroidCheckinProto and Device proto.
|
47
|
+
"""
|
48
|
+
|
49
|
+
DEVICE_ANDROID_OS: DeviceType.ValueType # 1
|
50
|
+
"""Android Device"""
|
51
|
+
DEVICE_IOS_OS: DeviceType.ValueType # 2
|
52
|
+
"""Apple IOS device"""
|
53
|
+
DEVICE_CHROME_BROWSER: DeviceType.ValueType # 3
|
54
|
+
"""Chrome browser - Not Chrome OS. No hardware records."""
|
55
|
+
DEVICE_CHROME_OS: DeviceType.ValueType # 4
|
56
|
+
"""Chrome OS"""
|
57
|
+
global___DeviceType = DeviceType
|
58
|
+
|
59
|
+
@typing_extensions.final
|
60
|
+
class ChromeBuildProto(google.protobuf.message.Message):
|
61
|
+
"""Build characteristics unique to the Chrome browser, and Chrome OS"""
|
62
|
+
|
63
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
64
|
+
|
65
|
+
class _Platform:
|
66
|
+
ValueType = typing.NewType("ValueType", builtins.int)
|
67
|
+
V: typing_extensions.TypeAlias = ValueType
|
68
|
+
|
69
|
+
class _PlatformEnumTypeWrapper(
|
70
|
+
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
|
71
|
+
ChromeBuildProto._Platform.ValueType
|
72
|
+
],
|
73
|
+
builtins.type,
|
74
|
+
):
|
75
|
+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
76
|
+
PLATFORM_WIN: ChromeBuildProto._Platform.ValueType # 1
|
77
|
+
PLATFORM_MAC: ChromeBuildProto._Platform.ValueType # 2
|
78
|
+
PLATFORM_LINUX: ChromeBuildProto._Platform.ValueType # 3
|
79
|
+
PLATFORM_CROS: ChromeBuildProto._Platform.ValueType # 4
|
80
|
+
PLATFORM_IOS: ChromeBuildProto._Platform.ValueType # 5
|
81
|
+
PLATFORM_ANDROID: ChromeBuildProto._Platform.ValueType # 6
|
82
|
+
"""Just a placeholder. Likely don't need it due to the presence of the
|
83
|
+
Android GCM on phone/tablet devices.
|
84
|
+
"""
|
85
|
+
|
86
|
+
class Platform(_Platform, metaclass=_PlatformEnumTypeWrapper): ...
|
87
|
+
PLATFORM_WIN: ChromeBuildProto.Platform.ValueType # 1
|
88
|
+
PLATFORM_MAC: ChromeBuildProto.Platform.ValueType # 2
|
89
|
+
PLATFORM_LINUX: ChromeBuildProto.Platform.ValueType # 3
|
90
|
+
PLATFORM_CROS: ChromeBuildProto.Platform.ValueType # 4
|
91
|
+
PLATFORM_IOS: ChromeBuildProto.Platform.ValueType # 5
|
92
|
+
PLATFORM_ANDROID: ChromeBuildProto.Platform.ValueType # 6
|
93
|
+
"""Just a placeholder. Likely don't need it due to the presence of the
|
94
|
+
Android GCM on phone/tablet devices.
|
95
|
+
"""
|
96
|
+
|
97
|
+
class _Channel:
|
98
|
+
ValueType = typing.NewType("ValueType", builtins.int)
|
99
|
+
V: typing_extensions.TypeAlias = ValueType
|
100
|
+
|
101
|
+
class _ChannelEnumTypeWrapper(
|
102
|
+
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
|
103
|
+
ChromeBuildProto._Channel.ValueType
|
104
|
+
],
|
105
|
+
builtins.type,
|
106
|
+
):
|
107
|
+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
108
|
+
CHANNEL_STABLE: ChromeBuildProto._Channel.ValueType # 1
|
109
|
+
CHANNEL_BETA: ChromeBuildProto._Channel.ValueType # 2
|
110
|
+
CHANNEL_DEV: ChromeBuildProto._Channel.ValueType # 3
|
111
|
+
CHANNEL_CANARY: ChromeBuildProto._Channel.ValueType # 4
|
112
|
+
CHANNEL_UNKNOWN: ChromeBuildProto._Channel.ValueType # 5
|
113
|
+
"""for tip of tree or custom builds"""
|
114
|
+
|
115
|
+
class Channel(_Channel, metaclass=_ChannelEnumTypeWrapper): ...
|
116
|
+
CHANNEL_STABLE: ChromeBuildProto.Channel.ValueType # 1
|
117
|
+
CHANNEL_BETA: ChromeBuildProto.Channel.ValueType # 2
|
118
|
+
CHANNEL_DEV: ChromeBuildProto.Channel.ValueType # 3
|
119
|
+
CHANNEL_CANARY: ChromeBuildProto.Channel.ValueType # 4
|
120
|
+
CHANNEL_UNKNOWN: ChromeBuildProto.Channel.ValueType # 5
|
121
|
+
"""for tip of tree or custom builds"""
|
122
|
+
|
123
|
+
PLATFORM_FIELD_NUMBER: builtins.int
|
124
|
+
CHROME_VERSION_FIELD_NUMBER: builtins.int
|
125
|
+
CHANNEL_FIELD_NUMBER: builtins.int
|
126
|
+
platform: global___ChromeBuildProto.Platform.ValueType
|
127
|
+
"""The platform of the device."""
|
128
|
+
chrome_version: builtins.str
|
129
|
+
"""The Chrome instance's version."""
|
130
|
+
channel: global___ChromeBuildProto.Channel.ValueType
|
131
|
+
"""The Channel (build type) of Chrome."""
|
132
|
+
def __init__(
|
133
|
+
self,
|
134
|
+
*,
|
135
|
+
platform: global___ChromeBuildProto.Platform.ValueType | None = ...,
|
136
|
+
chrome_version: builtins.str | None = ...,
|
137
|
+
channel: global___ChromeBuildProto.Channel.ValueType | None = ...,
|
138
|
+
) -> None: ...
|
139
|
+
def HasField(
|
140
|
+
self,
|
141
|
+
field_name: typing_extensions.Literal[
|
142
|
+
"channel",
|
143
|
+
b"channel",
|
144
|
+
"chrome_version",
|
145
|
+
b"chrome_version",
|
146
|
+
"platform",
|
147
|
+
b"platform",
|
148
|
+
],
|
149
|
+
) -> builtins.bool: ...
|
150
|
+
def ClearField(
|
151
|
+
self,
|
152
|
+
field_name: typing_extensions.Literal[
|
153
|
+
"channel",
|
154
|
+
b"channel",
|
155
|
+
"chrome_version",
|
156
|
+
b"chrome_version",
|
157
|
+
"platform",
|
158
|
+
b"platform",
|
159
|
+
],
|
160
|
+
) -> None: ...
|
161
|
+
|
162
|
+
global___ChromeBuildProto = ChromeBuildProto
|
163
|
+
|
164
|
+
@typing_extensions.final
|
165
|
+
class AndroidCheckinProto(google.protobuf.message.Message):
|
166
|
+
"""Information sent by the device in a "checkin" request."""
|
167
|
+
|
168
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
169
|
+
|
170
|
+
LAST_CHECKIN_MSEC_FIELD_NUMBER: builtins.int
|
171
|
+
CELL_OPERATOR_FIELD_NUMBER: builtins.int
|
172
|
+
SIM_OPERATOR_FIELD_NUMBER: builtins.int
|
173
|
+
ROAMING_FIELD_NUMBER: builtins.int
|
174
|
+
USER_NUMBER_FIELD_NUMBER: builtins.int
|
175
|
+
TYPE_FIELD_NUMBER: builtins.int
|
176
|
+
CHROME_BUILD_FIELD_NUMBER: builtins.int
|
177
|
+
last_checkin_msec: builtins.int
|
178
|
+
"""Miliseconds since the Unix epoch of the device's last successful checkin."""
|
179
|
+
cell_operator: builtins.str
|
180
|
+
"""The current MCC+MNC of the mobile device's current cell."""
|
181
|
+
sim_operator: builtins.str
|
182
|
+
"""The MCC+MNC of the SIM card (different from operator if the
|
183
|
+
device is roaming, for instance).
|
184
|
+
"""
|
185
|
+
roaming: builtins.str
|
186
|
+
"""The device's current roaming state (reported starting in eclair builds).
|
187
|
+
Currently one of "{,not}mobile-{,not}roaming", if it is present at all.
|
188
|
+
"""
|
189
|
+
user_number: builtins.int
|
190
|
+
"""For devices supporting multiple user profiles (which may be
|
191
|
+
supported starting in jellybean), the ordinal number of the
|
192
|
+
profile that is checking in. This is 0 for the primary profile
|
193
|
+
(which can't be changed without wiping the device), and 1,2,3,...
|
194
|
+
for additional profiles (which can be added and deleted freely).
|
195
|
+
"""
|
196
|
+
type: global___DeviceType.ValueType
|
197
|
+
"""Class of device. Indicates the type of build proto
|
198
|
+
(IosBuildProto/ChromeBuildProto/AndroidBuildProto)
|
199
|
+
That is included in this proto
|
200
|
+
"""
|
201
|
+
@property
|
202
|
+
def chrome_build(self) -> global___ChromeBuildProto:
|
203
|
+
"""For devices running MCS on Chrome, build-specific characteristics
|
204
|
+
of the browser. There are no hardware aspects (except for ChromeOS).
|
205
|
+
This will only be populated for Chrome builds/ChromeOS devices
|
206
|
+
"""
|
207
|
+
def __init__(
|
208
|
+
self,
|
209
|
+
*,
|
210
|
+
last_checkin_msec: builtins.int | None = ...,
|
211
|
+
cell_operator: builtins.str | None = ...,
|
212
|
+
sim_operator: builtins.str | None = ...,
|
213
|
+
roaming: builtins.str | None = ...,
|
214
|
+
user_number: builtins.int | None = ...,
|
215
|
+
type: global___DeviceType.ValueType | None = ...,
|
216
|
+
chrome_build: global___ChromeBuildProto | None = ...,
|
217
|
+
) -> None: ...
|
218
|
+
def HasField(
|
219
|
+
self,
|
220
|
+
field_name: typing_extensions.Literal[
|
221
|
+
"cell_operator",
|
222
|
+
b"cell_operator",
|
223
|
+
"chrome_build",
|
224
|
+
b"chrome_build",
|
225
|
+
"last_checkin_msec",
|
226
|
+
b"last_checkin_msec",
|
227
|
+
"roaming",
|
228
|
+
b"roaming",
|
229
|
+
"sim_operator",
|
230
|
+
b"sim_operator",
|
231
|
+
"type",
|
232
|
+
b"type",
|
233
|
+
"user_number",
|
234
|
+
b"user_number",
|
235
|
+
],
|
236
|
+
) -> builtins.bool: ...
|
237
|
+
def ClearField(
|
238
|
+
self,
|
239
|
+
field_name: typing_extensions.Literal[
|
240
|
+
"cell_operator",
|
241
|
+
b"cell_operator",
|
242
|
+
"chrome_build",
|
243
|
+
b"chrome_build",
|
244
|
+
"last_checkin_msec",
|
245
|
+
b"last_checkin_msec",
|
246
|
+
"roaming",
|
247
|
+
b"roaming",
|
248
|
+
"sim_operator",
|
249
|
+
b"sim_operator",
|
250
|
+
"type",
|
251
|
+
b"type",
|
252
|
+
"user_number",
|
253
|
+
b"user_number",
|
254
|
+
],
|
255
|
+
) -> None: ...
|
256
|
+
|
257
|
+
global___AndroidCheckinProto = AndroidCheckinProto
|
@@ -0,0 +1,59 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: pycupra
|
3
|
+
Version: 0.1.13
|
4
|
+
Summary: A library to read and send vehicle data via Cupra/Seat portal using the same API calls as the MyCupra/MySeat mobile app.
|
5
|
+
License-Expression: Apache-2.0
|
6
|
+
Requires-Python: >=3.10
|
7
|
+
Description-Content-Type: text/markdown
|
8
|
+
License-File: LICENSE
|
9
|
+
Requires-Dist: aiohttp
|
10
|
+
Requires-Dist: beautifulsoup4
|
11
|
+
Requires-Dist: cryptography
|
12
|
+
Requires-Dist: lxml
|
13
|
+
Requires-Dist: PyJWT
|
14
|
+
Requires-Dist: xmltodict
|
15
|
+
Requires-Dist: pandas
|
16
|
+
Dynamic: license-file
|
17
|
+
|
18
|
+
# PyCupra
|
19
|
+
|
20
|
+
A library to read and send vehicle data via Cupra/Seat portal using the same API calls as the MyCupra/MySeat mobile app.
|
21
|
+
|
22
|
+
Fork of https://github.com/Farfar/seatconnect which in turn is a fork of:
|
23
|
+
Fork of https://github.com/lendy007/skodaconnect which in turn is a fork of:
|
24
|
+
https://github.com/robinostlund/volkswagencarnet
|
25
|
+
|
26
|
+
## Information
|
27
|
+
|
28
|
+
Retrieve statistics about your Cupra/Seat from the Cupra/Seat Connect online service
|
29
|
+
|
30
|
+
No licence, public domain, no guarantees, feel free to use for anything. Please contribute improvements/bugfixes etc.
|
31
|
+
|
32
|
+
## Breaking changes
|
33
|
+
|
34
|
+
- The method vehicle.update(updateType) supports 3 different update types:
|
35
|
+
- updateType=0: Small update (=only get_basiccardata() and get_statusreport are called). If the last full update is more than 1100 seconds ago, then a full update is performed.
|
36
|
+
- updateType=1: Full update (nearly all get-methods are called. The model images and the capabilitites are refreshed only every 2 hours.)
|
37
|
+
- updateType=2: Like updateType=0, but ignoring the nightly update reduction
|
38
|
+
|
39
|
+
- Nightly update reduction: If nightly reduction is activated and the current time is within the time frame between 22:00 and 05:00, then vehicle.update(0) performs a full update, if the last full update is more than 1700 seconds ago. If that's not the case, vehicle.update(0) does nothing.
|
40
|
+
|
41
|
+
- PyCupra can ask the Seat/Cupra portal to send push notifications to PyCupra if the charging status or the climatisation status has changed or when the API has finished a request like lock or unlock vehicle, start or stop charging or change departure timers or ....
|
42
|
+
|
43
|
+
## Thanks to
|
44
|
+
|
45
|
+
- [RobinostLund](https://github.com/robinostlund/volkswagencarnet) for initial project for Volkswagen Carnet I was able to fork
|
46
|
+
- [Farfar](https://github.com/Farfar) for modifications related to electric engines
|
47
|
+
- [tanelvakker](https://github.com/tanelvakker) for modifications related to correct SPIN handling for various actions and using correct URLs also for MY2021
|
48
|
+
- [sdb9696](https://github.com/sdb9696) for the firebase-messaging package that is used in PyCupra with only minor modifications
|
49
|
+
|
50
|
+
### Example
|
51
|
+
|
52
|
+
For an extensive example, please use the code found in example/PyCupra.py.
|
53
|
+
When logged in the library will automatically create a vehicle object for every car registered to the account. Initially no data is fetched at all. Use the doLogin method and it will signin with the credentials used for the class constructor. After a successful login, the tokens are stored in a json file. Later doLogin calls can use the token file instead of the credentials.
|
54
|
+
Method get_vehicles will fetch vehicle basic information and create Vehicle class objects for all associated vehicles in account.
|
55
|
+
To update all available data use the update_all method of the Connect class. This will call the update function for all registered vehicles, which in turn will fetch data from all available API endpoints.
|
56
|
+
|
57
|
+
The file *pycupra_credentials.json.demo* explains the data structure of the credentials file.
|
58
|
+
|
59
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
[build-system]
|
2
|
+
requires = ["setuptools"]
|
3
|
+
|
4
|
+
[tool.setuptools.packages.find]
|
5
|
+
exclude = ["www"]
|
6
|
+
|
7
|
+
[project]
|
8
|
+
name = "pycupra"
|
9
|
+
version = "0.1.13"
|
10
|
+
description="A library to read and send vehicle data via Cupra/Seat portal using the same API calls as the MyCupra/MySeat mobile app."
|
11
|
+
readme="README.md"
|
12
|
+
license = "Apache-2.0"
|
13
|
+
license-files = ["LICEN[CS]E*"]
|
14
|
+
requires-python = ">=3.10"
|
15
|
+
dependencies = [
|
16
|
+
"aiohttp",
|
17
|
+
"beautifulsoup4",
|
18
|
+
"cryptography",
|
19
|
+
"lxml",
|
20
|
+
"PyJWT",
|
21
|
+
"xmltodict",
|
22
|
+
"pandas"
|
23
|
+
]
|
pycupra-0.1.12/PKG-INFO
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: pycupra
|
3
|
-
Version: 0.1.12
|
4
|
-
Requires-Python: >=3.10
|
5
|
-
License-File: LICENSE
|
6
|
-
Requires-Dist: aiohttp
|
7
|
-
Requires-Dist: beautifulsoup4
|
8
|
-
Requires-Dist: cryptography
|
9
|
-
Requires-Dist: lxml
|
10
|
-
Requires-Dist: PyJWT
|
11
|
-
Requires-Dist: xmltodict
|
12
|
-
Requires-Dist: pandas
|
13
|
-
Dynamic: license-file
|
@@ -1,13 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: pycupra
|
3
|
-
Version: 0.1.12
|
4
|
-
Requires-Python: >=3.10
|
5
|
-
License-File: LICENSE
|
6
|
-
Requires-Dist: aiohttp
|
7
|
-
Requires-Dist: beautifulsoup4
|
8
|
-
Requires-Dist: cryptography
|
9
|
-
Requires-Dist: lxml
|
10
|
-
Requires-Dist: PyJWT
|
11
|
-
Requires-Dist: xmltodict
|
12
|
-
Requires-Dist: pandas
|
13
|
-
Dynamic: license-file
|
@@ -1 +0,0 @@
|
|
1
|
-
pycupra
|
pycupra-0.1.12/pyproject.toml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
[build-system]
|
2
|
-
requires = ["setuptools"]
|
3
|
-
|
4
|
-
[project]
|
5
|
-
name = "pycupra"
|
6
|
-
version = "0.1.12"
|
7
|
-
requires-python = ">=3.10"
|
8
|
-
dependencies = [
|
9
|
-
"aiohttp",
|
10
|
-
"beautifulsoup4",
|
11
|
-
"cryptography",
|
12
|
-
"lxml",
|
13
|
-
"PyJWT",
|
14
|
-
"xmltodict",
|
15
|
-
"pandas"
|
16
|
-
]
|
pycupra-0.1.12/requirements.txt
DELETED
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
|
File without changes
|
File without changes
|