pycupra 0.1.10__py3-none-any.whl → 0.1.12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pycupra/__version__.py +1 -1
- pycupra/connection.py +6 -1
- pycupra/firebase_messaging/android_checkin.proto +96 -0
- pycupra/firebase_messaging/checkin.proto +155 -0
- pycupra/firebase_messaging/mcs.proto +328 -0
- pycupra/vehicle.py +27 -23
- pycupra-0.1.12.dist-info/METADATA +13 -0
- {pycupra-0.1.10.dist-info → pycupra-0.1.12.dist-info}/RECORD +11 -8
- {pycupra-0.1.10.dist-info → pycupra-0.1.12.dist-info}/WHEEL +1 -1
- pycupra-0.1.10.dist-info/METADATA +0 -67
- {pycupra-0.1.10.dist-info → pycupra-0.1.12.dist-info}/licenses/LICENSE +0 -0
- {pycupra-0.1.10.dist-info → pycupra-0.1.12.dist-info}/top_level.txt +0 -0
pycupra/__version__.py
CHANGED
pycupra/connection.py
CHANGED
@@ -839,7 +839,12 @@ class Connection:
|
|
839
839
|
if response.get('capabilities', False):
|
840
840
|
vehicle["capabilities"]=response.get('capabilities')
|
841
841
|
else:
|
842
|
-
_LOGGER.warning(f"Failed to aquire capabilities information about vehicle with VIN {vehicle}")
|
842
|
+
_LOGGER.warning(f"Failed to aquire capabilities information about vehicle with VIN {vehicle}.")
|
843
|
+
if vehicle.get('capabilities',None)!=None:
|
844
|
+
_LOGGER.warning(f"Keeping the old capability information.")
|
845
|
+
else:
|
846
|
+
_LOGGER.warning(f"Initialising vehicle without capabilities.")
|
847
|
+
vehicle["capabilities"]=[]
|
843
848
|
response = await self.get(eval(f"f'{API_CONNECTION}'"))
|
844
849
|
#self._session_headers['Accept'] = 'application/json'
|
845
850
|
if response.get('connection', False):
|
@@ -0,0 +1,96 @@
|
|
1
|
+
// Copyright 2014 The Chromium Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
//
|
5
|
+
// Logging information for Android "checkin" events (automatic, periodic
|
6
|
+
// requests made by Android devices to the server).
|
7
|
+
|
8
|
+
syntax = "proto2";
|
9
|
+
|
10
|
+
option optimize_for = LITE_RUNTIME;
|
11
|
+
package checkin_proto;
|
12
|
+
|
13
|
+
// Build characteristics unique to the Chrome browser, and Chrome OS
|
14
|
+
message ChromeBuildProto {
|
15
|
+
enum Platform {
|
16
|
+
PLATFORM_WIN = 1;
|
17
|
+
PLATFORM_MAC = 2;
|
18
|
+
PLATFORM_LINUX = 3;
|
19
|
+
PLATFORM_CROS = 4;
|
20
|
+
PLATFORM_IOS = 5;
|
21
|
+
// Just a placeholder. Likely don't need it due to the presence of the
|
22
|
+
// Android GCM on phone/tablet devices.
|
23
|
+
PLATFORM_ANDROID = 6;
|
24
|
+
}
|
25
|
+
|
26
|
+
enum Channel {
|
27
|
+
CHANNEL_STABLE = 1;
|
28
|
+
CHANNEL_BETA = 2;
|
29
|
+
CHANNEL_DEV = 3;
|
30
|
+
CHANNEL_CANARY = 4;
|
31
|
+
CHANNEL_UNKNOWN = 5; // for tip of tree or custom builds
|
32
|
+
}
|
33
|
+
|
34
|
+
// The platform of the device.
|
35
|
+
optional Platform platform = 1;
|
36
|
+
|
37
|
+
// The Chrome instance's version.
|
38
|
+
optional string chrome_version = 2;
|
39
|
+
|
40
|
+
// The Channel (build type) of Chrome.
|
41
|
+
optional Channel channel = 3;
|
42
|
+
}
|
43
|
+
|
44
|
+
// Information sent by the device in a "checkin" request.
|
45
|
+
message AndroidCheckinProto {
|
46
|
+
// Miliseconds since the Unix epoch of the device's last successful checkin.
|
47
|
+
optional int64 last_checkin_msec = 2;
|
48
|
+
|
49
|
+
// The current MCC+MNC of the mobile device's current cell.
|
50
|
+
optional string cell_operator = 6;
|
51
|
+
|
52
|
+
// The MCC+MNC of the SIM card (different from operator if the
|
53
|
+
// device is roaming, for instance).
|
54
|
+
optional string sim_operator = 7;
|
55
|
+
|
56
|
+
// The device's current roaming state (reported starting in eclair builds).
|
57
|
+
// Currently one of "{,not}mobile-{,not}roaming", if it is present at all.
|
58
|
+
optional string roaming = 8;
|
59
|
+
|
60
|
+
// For devices supporting multiple user profiles (which may be
|
61
|
+
// supported starting in jellybean), the ordinal number of the
|
62
|
+
// profile that is checking in. This is 0 for the primary profile
|
63
|
+
// (which can't be changed without wiping the device), and 1,2,3,...
|
64
|
+
// for additional profiles (which can be added and deleted freely).
|
65
|
+
optional int32 user_number = 9;
|
66
|
+
|
67
|
+
// Class of device. Indicates the type of build proto
|
68
|
+
// (IosBuildProto/ChromeBuildProto/AndroidBuildProto)
|
69
|
+
// That is included in this proto
|
70
|
+
optional DeviceType type = 12 [default = DEVICE_ANDROID_OS];
|
71
|
+
|
72
|
+
// For devices running MCS on Chrome, build-specific characteristics
|
73
|
+
// of the browser. There are no hardware aspects (except for ChromeOS).
|
74
|
+
// This will only be populated for Chrome builds/ChromeOS devices
|
75
|
+
optional checkin_proto.ChromeBuildProto chrome_build = 13;
|
76
|
+
|
77
|
+
// Note: Some of the Android specific optional fields were skipped to limit
|
78
|
+
// the protobuf definition.
|
79
|
+
// Next 14
|
80
|
+
}
|
81
|
+
|
82
|
+
// enum values correspond to the type of device.
|
83
|
+
// Used in the AndroidCheckinProto and Device proto.
|
84
|
+
enum DeviceType {
|
85
|
+
// Android Device
|
86
|
+
DEVICE_ANDROID_OS = 1;
|
87
|
+
|
88
|
+
// Apple IOS device
|
89
|
+
DEVICE_IOS_OS = 2;
|
90
|
+
|
91
|
+
// Chrome browser - Not Chrome OS. No hardware records.
|
92
|
+
DEVICE_CHROME_BROWSER = 3;
|
93
|
+
|
94
|
+
// Chrome OS
|
95
|
+
DEVICE_CHROME_OS = 4;
|
96
|
+
}
|
@@ -0,0 +1,155 @@
|
|
1
|
+
// Copyright 2014 The Chromium Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
//
|
5
|
+
// Request and reply to the "checkin server" devices poll every few hours.
|
6
|
+
|
7
|
+
syntax = "proto2";
|
8
|
+
|
9
|
+
option optimize_for = LITE_RUNTIME;
|
10
|
+
|
11
|
+
package checkin_proto;
|
12
|
+
|
13
|
+
import "android_checkin.proto";
|
14
|
+
|
15
|
+
// A concrete name/value pair sent to the device's Gservices database.
|
16
|
+
message GservicesSetting {
|
17
|
+
required bytes name = 1;
|
18
|
+
required bytes value = 2;
|
19
|
+
}
|
20
|
+
|
21
|
+
// Devices send this every few hours to tell us how they're doing.
|
22
|
+
message AndroidCheckinRequest {
|
23
|
+
// IMEI (used by GSM phones) is sent and stored as 15 decimal
|
24
|
+
// digits; the 15th is a check digit.
|
25
|
+
optional string imei = 1; // IMEI, reported but not logged.
|
26
|
+
|
27
|
+
// MEID (used by CDMA phones) is sent and stored as 14 hexadecimal
|
28
|
+
// digits (no check digit).
|
29
|
+
optional string meid = 10; // MEID, reported but not logged.
|
30
|
+
|
31
|
+
// MAC address (used by non-phone devices). 12 hexadecimal digits;
|
32
|
+
// no separators (eg "0016E6513AC2", not "00:16:E6:51:3A:C2").
|
33
|
+
repeated string mac_addr = 9; // MAC address, reported but not logged.
|
34
|
+
|
35
|
+
// An array parallel to mac_addr, describing the type of interface.
|
36
|
+
// Currently accepted values: "wifi", "ethernet", "bluetooth". If
|
37
|
+
// not present, "wifi" is assumed.
|
38
|
+
repeated string mac_addr_type = 19;
|
39
|
+
|
40
|
+
// Serial number (a manufacturer-defined unique hardware
|
41
|
+
// identifier). Alphanumeric, case-insensitive.
|
42
|
+
optional string serial_number = 16;
|
43
|
+
|
44
|
+
// Older CDMA networks use an ESN (8 hex digits) instead of an MEID.
|
45
|
+
optional string esn = 17; // ESN, reported but not logged
|
46
|
+
|
47
|
+
optional int64 id = 2; // Android device ID, not logged
|
48
|
+
optional int64 logging_id = 7; // Pseudonymous logging ID for Sawmill
|
49
|
+
optional string digest = 3; // Digest of device provisioning, not logged.
|
50
|
+
optional string locale = 6; // Current locale in standard (xx_XX) format
|
51
|
+
required AndroidCheckinProto checkin = 4;
|
52
|
+
|
53
|
+
// DEPRECATED, see AndroidCheckinProto.requested_group
|
54
|
+
optional string desired_build = 5;
|
55
|
+
|
56
|
+
// Blob of data from the Market app to be passed to Market API server
|
57
|
+
optional string market_checkin = 8;
|
58
|
+
|
59
|
+
// SID cookies of any google accounts stored on the phone. Not logged.
|
60
|
+
repeated string account_cookie = 11;
|
61
|
+
|
62
|
+
// Time zone. Not currently logged.
|
63
|
+
optional string time_zone = 12;
|
64
|
+
|
65
|
+
// Security token used to validate the checkin request.
|
66
|
+
// Required for android IDs issued to Froyo+ devices, not for legacy IDs.
|
67
|
+
optional fixed64 security_token = 13;
|
68
|
+
|
69
|
+
// Version of checkin protocol.
|
70
|
+
//
|
71
|
+
// There are currently two versions:
|
72
|
+
//
|
73
|
+
// - version field missing: android IDs are assigned based on
|
74
|
+
// hardware identifiers. unsecured in the sense that you can
|
75
|
+
// "unregister" someone's phone by sending a registration request
|
76
|
+
// with their IMEI/MEID/MAC.
|
77
|
+
//
|
78
|
+
// - version=2: android IDs are assigned randomly. The device is
|
79
|
+
// sent a security token that must be included in all future
|
80
|
+
// checkins for that android id.
|
81
|
+
//
|
82
|
+
// - version=3: same as version 2, but the 'fragment' field is
|
83
|
+
// provided, and the device understands incremental updates to the
|
84
|
+
// gservices table (ie, only returning the keys whose values have
|
85
|
+
// changed.)
|
86
|
+
//
|
87
|
+
// (version=1 was skipped to avoid confusion with the "missing"
|
88
|
+
// version field that is effectively version 1.)
|
89
|
+
optional int32 version = 14;
|
90
|
+
|
91
|
+
// OTA certs accepted by device (base-64 SHA-1 of cert files). Not
|
92
|
+
// logged.
|
93
|
+
repeated string ota_cert = 15;
|
94
|
+
|
95
|
+
// Honeycomb and newer devices send configuration data with their checkin.
|
96
|
+
// optional DeviceConfigurationProto device_configuration = 18;
|
97
|
+
|
98
|
+
// A single CheckinTask on the device may lead to multiple checkin
|
99
|
+
// requests if there is too much log data to upload in a single
|
100
|
+
// request. For version 3 and up, this field will be filled in with
|
101
|
+
// the number of the request, starting with 0.
|
102
|
+
optional int32 fragment = 20;
|
103
|
+
|
104
|
+
// For devices supporting multiple users, the name of the current
|
105
|
+
// profile (they all check in independently, just as if they were
|
106
|
+
// multiple physical devices). This may not be set, even if the
|
107
|
+
// device is using multiuser. (checkin.user_number should be set to
|
108
|
+
// the ordinal of the user.)
|
109
|
+
optional string user_name = 21;
|
110
|
+
|
111
|
+
// For devices supporting multiple user profiles, the serial number
|
112
|
+
// for the user checking in. Not logged. May not be set, even if
|
113
|
+
// the device supportes multiuser. checkin.user_number is the
|
114
|
+
// ordinal of the user (0, 1, 2, ...), which may be reused if users
|
115
|
+
// are deleted and re-created. user_serial_number is never reused
|
116
|
+
// (unless the device is wiped).
|
117
|
+
optional int32 user_serial_number = 22;
|
118
|
+
|
119
|
+
// NEXT TAG: 23
|
120
|
+
}
|
121
|
+
|
122
|
+
// The response to the device.
|
123
|
+
message AndroidCheckinResponse {
|
124
|
+
required bool stats_ok = 1; // Whether statistics were recorded properly.
|
125
|
+
optional int64 time_msec = 3; // Time of day from server (Java epoch).
|
126
|
+
// repeated AndroidIntentProto intent = 2;
|
127
|
+
|
128
|
+
// Provisioning is sent if the request included an obsolete digest.
|
129
|
+
//
|
130
|
+
// For version <= 2, 'digest' contains the digest that should be
|
131
|
+
// sent back to the server on the next checkin, and 'setting'
|
132
|
+
// contains the entire gservices table (which replaces the entire
|
133
|
+
// current table on the device).
|
134
|
+
//
|
135
|
+
// for version >= 3, 'digest' will be absent. If 'settings_diff'
|
136
|
+
// is false, then 'setting' contains the entire table, as in version
|
137
|
+
// 2. If 'settings_diff' is true, then 'delete_setting' contains
|
138
|
+
// the keys to delete, and 'setting' contains only keys to be added
|
139
|
+
// or for which the value has changed. All other keys in the
|
140
|
+
// current table should be left untouched. If 'settings_diff' is
|
141
|
+
// absent, don't touch the existing gservices table.
|
142
|
+
//
|
143
|
+
optional string digest = 4;
|
144
|
+
optional bool settings_diff = 9;
|
145
|
+
repeated string delete_setting = 10;
|
146
|
+
repeated GservicesSetting setting = 5;
|
147
|
+
|
148
|
+
optional bool market_ok = 6; // If Market got the market_checkin data OK.
|
149
|
+
|
150
|
+
optional fixed64 android_id = 7; // From the request, or newly assigned
|
151
|
+
optional fixed64 security_token = 8; // The associated security token
|
152
|
+
|
153
|
+
optional string version_info = 11;
|
154
|
+
// NEXT TAG: 12
|
155
|
+
}
|
@@ -0,0 +1,328 @@
|
|
1
|
+
// Copyright 2013 The Chromium Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
//
|
5
|
+
// MCS protocol for communication between Chrome client and Mobile Connection
|
6
|
+
// Server .
|
7
|
+
|
8
|
+
syntax = "proto2";
|
9
|
+
|
10
|
+
option optimize_for = LITE_RUNTIME;
|
11
|
+
|
12
|
+
package mcs_proto;
|
13
|
+
|
14
|
+
/*
|
15
|
+
Common fields/comments:
|
16
|
+
|
17
|
+
stream_id: no longer sent by server, each side keeps a counter
|
18
|
+
last_stream_id_received: sent only if a packet was received since last time
|
19
|
+
a last_stream was sent
|
20
|
+
status: new bitmask including the 'idle' as bit 0.
|
21
|
+
|
22
|
+
*/
|
23
|
+
|
24
|
+
/**
|
25
|
+
TAG: 0
|
26
|
+
*/
|
27
|
+
message HeartbeatPing {
|
28
|
+
optional int32 stream_id = 1;
|
29
|
+
optional int32 last_stream_id_received = 2;
|
30
|
+
optional int64 status = 3;
|
31
|
+
}
|
32
|
+
|
33
|
+
/**
|
34
|
+
TAG: 1
|
35
|
+
*/
|
36
|
+
message HeartbeatAck {
|
37
|
+
optional int32 stream_id = 1;
|
38
|
+
optional int32 last_stream_id_received = 2;
|
39
|
+
optional int64 status = 3;
|
40
|
+
}
|
41
|
+
|
42
|
+
message ErrorInfo {
|
43
|
+
required int32 code = 1;
|
44
|
+
optional string message = 2;
|
45
|
+
optional string type = 3;
|
46
|
+
optional Extension extension = 4;
|
47
|
+
}
|
48
|
+
|
49
|
+
// MobileSettings class.
|
50
|
+
// "u:f", "u:b", "u:s" - multi user devices reporting foreground, background
|
51
|
+
// and stopped users.
|
52
|
+
// hbping: heatbeat ping interval
|
53
|
+
// rmq2v: include explicit stream IDs
|
54
|
+
|
55
|
+
message Setting {
|
56
|
+
required string name = 1;
|
57
|
+
required string value = 2;
|
58
|
+
}
|
59
|
+
|
60
|
+
message HeartbeatStat {
|
61
|
+
required string ip = 1;
|
62
|
+
required bool timeout = 2;
|
63
|
+
required int32 interval_ms = 3;
|
64
|
+
}
|
65
|
+
|
66
|
+
message HeartbeatConfig {
|
67
|
+
optional bool upload_stat = 1;
|
68
|
+
optional string ip = 2;
|
69
|
+
optional int32 interval_ms = 3;
|
70
|
+
}
|
71
|
+
|
72
|
+
// ClientEvents are used to inform the server of failed and successful
|
73
|
+
// connections.
|
74
|
+
message ClientEvent {
|
75
|
+
enum Type {
|
76
|
+
UNKNOWN = 0;
|
77
|
+
// Count of discarded events if the buffer filled up and was trimmed.
|
78
|
+
DISCARDED_EVENTS = 1;
|
79
|
+
// Failed connection event: the connection failed to be established or we
|
80
|
+
// had a login error.
|
81
|
+
FAILED_CONNECTION = 2;
|
82
|
+
// Successful connection event: information about the last successful
|
83
|
+
// connection, including the time at which it was established.
|
84
|
+
SUCCESSFUL_CONNECTION = 3;
|
85
|
+
}
|
86
|
+
|
87
|
+
// Common fields [1-99]
|
88
|
+
optional Type type = 1;
|
89
|
+
|
90
|
+
// Fields for DISCARDED_EVENTS messages [100-199]
|
91
|
+
optional uint32 number_discarded_events = 100;
|
92
|
+
|
93
|
+
// Fields for FAILED_CONNECTION and SUCCESSFUL_CONNECTION messages [200-299]
|
94
|
+
// Network type is a value in net::NetworkChangeNotifier::ConnectionType.
|
95
|
+
optional int32 network_type = 200;
|
96
|
+
// Reserved for network_port.
|
97
|
+
reserved 201;
|
98
|
+
optional uint64 time_connection_started_ms = 202;
|
99
|
+
optional uint64 time_connection_ended_ms = 203;
|
100
|
+
// Error code should be a net::Error value.
|
101
|
+
optional int32 error_code = 204;
|
102
|
+
|
103
|
+
// Fields for SUCCESSFUL_CONNECTION messages [300-399]
|
104
|
+
optional uint64 time_connection_established_ms = 300;
|
105
|
+
}
|
106
|
+
|
107
|
+
/**
|
108
|
+
TAG: 2
|
109
|
+
*/
|
110
|
+
message LoginRequest {
|
111
|
+
enum AuthService {
|
112
|
+
ANDROID_ID = 2;
|
113
|
+
}
|
114
|
+
required string id = 1; // Must be present ( proto required ), may be empty
|
115
|
+
// string.
|
116
|
+
// mcs.android.com.
|
117
|
+
required string domain = 2;
|
118
|
+
// Decimal android ID
|
119
|
+
required string user = 3;
|
120
|
+
|
121
|
+
required string resource = 4;
|
122
|
+
|
123
|
+
// Secret
|
124
|
+
required string auth_token = 5;
|
125
|
+
|
126
|
+
// Format is: android-HEX_DEVICE_ID
|
127
|
+
// The user is the decimal value.
|
128
|
+
optional string device_id = 6;
|
129
|
+
|
130
|
+
// RMQ1 - no longer used
|
131
|
+
optional int64 last_rmq_id = 7;
|
132
|
+
|
133
|
+
repeated Setting setting = 8;
|
134
|
+
//optional int32 compress = 9;
|
135
|
+
repeated string received_persistent_id = 10;
|
136
|
+
|
137
|
+
// Replaced by "rmq2v" setting
|
138
|
+
// optional bool include_stream_ids = 11;
|
139
|
+
|
140
|
+
optional bool adaptive_heartbeat = 12;
|
141
|
+
optional HeartbeatStat heartbeat_stat = 13;
|
142
|
+
// Must be true.
|
143
|
+
optional bool use_rmq2 = 14;
|
144
|
+
optional int64 account_id = 15;
|
145
|
+
|
146
|
+
// ANDROID_ID = 2
|
147
|
+
optional AuthService auth_service = 16;
|
148
|
+
|
149
|
+
optional int32 network_type = 17;
|
150
|
+
optional int64 status = 18;
|
151
|
+
|
152
|
+
// 19, 20, and 21 are not currently populated by Chrome.
|
153
|
+
reserved 19, 20, 21;
|
154
|
+
|
155
|
+
// Events recorded on the client after the last successful connection.
|
156
|
+
repeated ClientEvent client_event = 22;
|
157
|
+
}
|
158
|
+
|
159
|
+
/**
|
160
|
+
* TAG: 3
|
161
|
+
*/
|
162
|
+
message LoginResponse {
|
163
|
+
required string id = 1;
|
164
|
+
// Not used.
|
165
|
+
optional string jid = 2;
|
166
|
+
// Null if login was ok.
|
167
|
+
optional ErrorInfo error = 3;
|
168
|
+
repeated Setting setting = 4;
|
169
|
+
optional int32 stream_id = 5;
|
170
|
+
// Should be "1"
|
171
|
+
optional int32 last_stream_id_received = 6;
|
172
|
+
optional HeartbeatConfig heartbeat_config = 7;
|
173
|
+
// used by the client to synchronize with the server timestamp.
|
174
|
+
optional int64 server_timestamp = 8;
|
175
|
+
}
|
176
|
+
|
177
|
+
message StreamErrorStanza {
|
178
|
+
required string type = 1;
|
179
|
+
optional string text = 2;
|
180
|
+
}
|
181
|
+
|
182
|
+
/**
|
183
|
+
* TAG: 4
|
184
|
+
*/
|
185
|
+
message Close {
|
186
|
+
}
|
187
|
+
|
188
|
+
message Extension {
|
189
|
+
// 12: SelectiveAck
|
190
|
+
// 13: StreamAck
|
191
|
+
required int32 id = 1;
|
192
|
+
required bytes data = 2;
|
193
|
+
}
|
194
|
+
|
195
|
+
/**
|
196
|
+
* TAG: 7
|
197
|
+
* IqRequest must contain a single extension. IqResponse may contain 0 or 1
|
198
|
+
* extensions.
|
199
|
+
*/
|
200
|
+
message IqStanza {
|
201
|
+
enum IqType {
|
202
|
+
GET = 0;
|
203
|
+
SET = 1;
|
204
|
+
RESULT = 2;
|
205
|
+
IQ_ERROR = 3;
|
206
|
+
}
|
207
|
+
|
208
|
+
optional int64 rmq_id = 1;
|
209
|
+
required IqType type = 2;
|
210
|
+
required string id = 3;
|
211
|
+
optional string from = 4;
|
212
|
+
optional string to = 5;
|
213
|
+
optional ErrorInfo error = 6;
|
214
|
+
|
215
|
+
// Only field used in the 38+ protocol (besides common last_stream_id_received, status, rmq_id)
|
216
|
+
optional Extension extension = 7;
|
217
|
+
|
218
|
+
optional string persistent_id = 8;
|
219
|
+
optional int32 stream_id = 9;
|
220
|
+
optional int32 last_stream_id_received = 10;
|
221
|
+
optional int64 account_id = 11;
|
222
|
+
optional int64 status = 12;
|
223
|
+
}
|
224
|
+
|
225
|
+
message AppData {
|
226
|
+
required string key = 1;
|
227
|
+
required string value = 2;
|
228
|
+
}
|
229
|
+
|
230
|
+
/**
|
231
|
+
* TAG: 8
|
232
|
+
*/
|
233
|
+
message DataMessageStanza {
|
234
|
+
// Not used.
|
235
|
+
// optional int64 rmq_id = 1;
|
236
|
+
|
237
|
+
// This is the message ID, set by client, DMP.9 (message_id)
|
238
|
+
optional string id = 2;
|
239
|
+
|
240
|
+
// Project ID of the sender, DMP.1
|
241
|
+
required string from = 3;
|
242
|
+
|
243
|
+
// Part of DMRequest - also the key in DataMessageProto.
|
244
|
+
optional string to = 4;
|
245
|
+
|
246
|
+
// Package name. DMP.2
|
247
|
+
required string category = 5;
|
248
|
+
|
249
|
+
// The collapsed key, DMP.3
|
250
|
+
optional string token = 6;
|
251
|
+
|
252
|
+
// User data + GOOGLE. prefixed special entries, DMP.4
|
253
|
+
repeated AppData app_data = 7;
|
254
|
+
|
255
|
+
// Not used.
|
256
|
+
optional bool from_trusted_server = 8;
|
257
|
+
|
258
|
+
// Part of the ACK protocol, returned in DataMessageResponse on server side.
|
259
|
+
// It's part of the key of DMP.
|
260
|
+
optional string persistent_id = 9;
|
261
|
+
|
262
|
+
// In-stream ack. Increments on each message sent - a bit redundant
|
263
|
+
// Not used in DMP/DMR.
|
264
|
+
optional int32 stream_id = 10;
|
265
|
+
optional int32 last_stream_id_received = 11;
|
266
|
+
|
267
|
+
// Not used.
|
268
|
+
// optional string permission = 12;
|
269
|
+
|
270
|
+
// Sent by the device shortly after registration.
|
271
|
+
optional string reg_id = 13;
|
272
|
+
|
273
|
+
// Not used.
|
274
|
+
// optional string pkg_signature = 14;
|
275
|
+
// Not used.
|
276
|
+
// optional string client_id = 15;
|
277
|
+
|
278
|
+
// serial number of the target user, DMP.8
|
279
|
+
// It is the 'serial number' according to user manager.
|
280
|
+
optional int64 device_user_id = 16;
|
281
|
+
|
282
|
+
// Time to live, in seconds.
|
283
|
+
optional int32 ttl = 17;
|
284
|
+
// Timestamp ( according to client ) when message was sent by app, in seconds
|
285
|
+
optional int64 sent = 18;
|
286
|
+
|
287
|
+
// How long has the message been queued before the flush, in seconds.
|
288
|
+
// This is needed to account for the time difference between server and
|
289
|
+
// client: server should adjust 'sent' based on its 'receive' time.
|
290
|
+
optional int32 queued = 19;
|
291
|
+
|
292
|
+
optional int64 status = 20;
|
293
|
+
|
294
|
+
// Optional field containing the binary payload of the message.
|
295
|
+
optional bytes raw_data = 21;
|
296
|
+
|
297
|
+
// Not used.
|
298
|
+
// The maximum delay of the message, in seconds.
|
299
|
+
// optional int32 max_delay = 22;
|
300
|
+
|
301
|
+
// Not used.
|
302
|
+
// How long the message was delayed before it was sent, in seconds.
|
303
|
+
// optional int32 actual_delay = 23;
|
304
|
+
|
305
|
+
// If set the server requests immediate ack. Used for important messages and
|
306
|
+
// for testing.
|
307
|
+
optional bool immediate_ack = 24;
|
308
|
+
|
309
|
+
// Not used.
|
310
|
+
// Enables message receipts from MCS/GCM back to CCS clients
|
311
|
+
// optional bool delivery_receipt_requested = 25;
|
312
|
+
}
|
313
|
+
|
314
|
+
/**
|
315
|
+
Included in IQ with ID 13, sent from client or server after 10 unconfirmed
|
316
|
+
messages.
|
317
|
+
*/
|
318
|
+
message StreamAck {
|
319
|
+
// No last_streamid_received required. This is included within an IqStanza,
|
320
|
+
// which includes the last_stream_id_received.
|
321
|
+
}
|
322
|
+
|
323
|
+
/**
|
324
|
+
Included in IQ sent after LoginResponse from server with ID 12.
|
325
|
+
*/
|
326
|
+
message SelectiveAck {
|
327
|
+
repeated string id = 1;
|
328
|
+
}
|
pycupra/vehicle.py
CHANGED
@@ -107,29 +107,33 @@ class Vehicle:
|
|
107
107
|
# return_exceptions=True
|
108
108
|
#)
|
109
109
|
# Extract information of relevant capabilities
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
if capa
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
110
|
+
if self._capabilities != None:
|
111
|
+
for capa in self._capabilities:
|
112
|
+
id=capa.get('id', '')
|
113
|
+
if self._relevantCapabilties.get(id, False):
|
114
|
+
data={}
|
115
|
+
data['active']=capa.get('active', False)
|
116
|
+
if capa.get('user-enabled', False):
|
117
|
+
data['reason']='user-enabled'
|
118
|
+
else:
|
119
|
+
data['reason']=capa.get('user-enabled', False)
|
120
|
+
if capa.get('status', False):
|
121
|
+
data['reason']=capa.get('status', '')
|
122
|
+
if capa.get('parameters', False):
|
123
|
+
if capa['parameters'].get('supportsCyclicTrips',False)==True or capa['parameters'].get('supportsCyclicTrips',False)=='true':
|
124
|
+
data['supportsCyclicTrips']=True
|
125
|
+
if capa['parameters'].get('supportsTargetStateOfCharge',False)==True or capa['parameters'].get('supportsTargetStateOfCharge',False)=='true':
|
126
|
+
data['supportsTargetStateOfCharge']=True
|
127
|
+
if capa['parameters'].get('supportsSingleTimer',False)==True or capa['parameters'].get('supportsSingleTimer',False)=='true':
|
128
|
+
data['supportsSingleTimer']=True
|
129
|
+
if capa['parameters'].get('supportsVehiclePositionedInProfileID',False)==True or capa['parameters'].get('supportsVehiclePositionedInProfileID',False)=='true':
|
130
|
+
data['supportsVehiclePositionedInProfileID']=True
|
131
|
+
if capa['parameters'].get('supportsTimerClimatisation',False)==True or capa['parameters'].get('supportsTimerClimatisation',False)=='true':
|
132
|
+
data['supportsTimerClimatisation']=True
|
133
|
+
self._relevantCapabilties[id].update(data)
|
134
|
+
else:
|
135
|
+
_LOGGER.warning(f"No capabilities information stored for vehicle with VIN {self.vin}")
|
136
|
+
|
133
137
|
|
134
138
|
|
135
139
|
|
@@ -0,0 +1,13 @@
|
|
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,25 +1,28 @@
|
|
1
1
|
pycupra/__init__.py,sha256=p0880jPkLqOErX3u3qaLboBLOsEHFpe44axApdaGeqI,231
|
2
|
-
pycupra/__version__.py,sha256=
|
3
|
-
pycupra/connection.py,sha256
|
2
|
+
pycupra/__version__.py,sha256=kEdT9rmuTn8dHldRpejGUjHjJ4l1riwWOihc1cu1NyQ,208
|
3
|
+
pycupra/connection.py,sha256=-wfamvOPP0gDGo5Picd2zx9pHGs90vVqqCxp6SFn6PQ,93278
|
4
4
|
pycupra/const.py,sha256=5b4uuNUE1AGZHmqQfIZv-76Ad20mJTXXQPGI8TU6FfY,10631
|
5
5
|
pycupra/dashboard.py,sha256=_8qlVr1k_L3_7A7dDc9ugzpGK_Dg6UZgv_Pp-1pPaPE,45337
|
6
6
|
pycupra/exceptions.py,sha256=Nq_F79GP8wjHf5lpvPy9TbSIrRHAJrFMo0T1N9TcgSQ,2917
|
7
7
|
pycupra/firebase.py,sha256=lmI4a8f5VAlmHAqP2OiJWZhn7dmhyHkIBxL252qdtkA,3454
|
8
8
|
pycupra/utilities.py,sha256=6sDxWP13-XtxmqhuBJBGdVbkj48BQ9AxFMrBPxH0J7g,2679
|
9
|
-
pycupra/vehicle.py,sha256=
|
9
|
+
pycupra/vehicle.py,sha256=svuZ9xabbHa67saOQ1yGJcB8WCxV3zJmp32LFl8f_kQ,164254
|
10
10
|
pycupra/firebase_messaging/__init__.py,sha256=oerLHWvEf4qRqu3GxSX6SLY_OYI430ydAiAhKtzyMEM,666
|
11
|
+
pycupra/firebase_messaging/android_checkin.proto,sha256=AW1Ew0iU3NdZpFCocNsG3MxFhEsoRcQH0yMpKhkj0Zg,3109
|
11
12
|
pycupra/firebase_messaging/android_checkin_pb2.py,sha256=-U1oGroFt3KRuGDieae3iTcux6mAfx1TFkE1Q35ul2E,2849
|
12
13
|
pycupra/firebase_messaging/android_checkin_pb2.pyi,sha256=7KL-zQIz2Zz7uftcLkv57Podzu-yk6trn50FN4X4A8E,9379
|
14
|
+
pycupra/firebase_messaging/checkin.proto,sha256=bTIfw9ffqmNRgOLmJjpCrbJsOPLb5jEcy58EH_CsGaY,6265
|
13
15
|
pycupra/firebase_messaging/checkin_pb2.py,sha256=lFzCIAkYz9NFUpRbVuW-2kM_EaYKVWHeifHS1PV2eHQ,2795
|
14
16
|
pycupra/firebase_messaging/checkin_pb2.pyi,sha256=mHOqbedt5jZDI20jcyFrTMSnQ0f_tq4zkIlHiaSC3xI,14626
|
15
17
|
pycupra/firebase_messaging/const.py,sha256=XMy8kJ37uBSkTpVpdLeSjxk5UIPuvDuo-rxYdgmo2G8,1191
|
16
18
|
pycupra/firebase_messaging/fcmpushclient.py,sha256=5kAp6rnl9EJqVPn9OfHFKUfFDRWA9LAVbfiL-pLRSqo,30550
|
17
19
|
pycupra/firebase_messaging/fcmregister.py,sha256=yZngC-0ZfTygtjfdzg03OW_3xk2n_uSQQ3Lrash5Y_E,18091
|
20
|
+
pycupra/firebase_messaging/mcs.proto,sha256=HUgnx-KTQiXIER1bJ0swpCt1W0BILru3lxhwmBezj-A,8265
|
18
21
|
pycupra/firebase_messaging/mcs_pb2.py,sha256=nwXY7IDgLYPxgpSGs6wyTSyYDdomQsyGqH8R8EgODLg,7733
|
19
22
|
pycupra/firebase_messaging/mcs_pb2.pyi,sha256=HfIhInC3wRg8_caKwUm-V3knE2jTdEQvBy6uXgQ5rHY,33959
|
20
23
|
pycupra/firebase_messaging/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
|
-
pycupra-0.1.
|
22
|
-
pycupra-0.1.
|
23
|
-
pycupra-0.1.
|
24
|
-
pycupra-0.1.
|
25
|
-
pycupra-0.1.
|
24
|
+
pycupra-0.1.12.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
25
|
+
pycupra-0.1.12.dist-info/METADATA,sha256=MSKr9mmmWw0m9UOiIkCrE6MUTU1BDtIw4XA_x7RSkWc,302
|
26
|
+
pycupra-0.1.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
27
|
+
pycupra-0.1.12.dist-info/top_level.txt,sha256=9Lbj_jG4JvpGwt6K3AwhWFc0XieDnuHFOP4x44wSXSQ,8
|
28
|
+
pycupra-0.1.12.dist-info/RECORD,,
|
@@ -1,67 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: pycupra
|
3
|
-
Version: 0.1.10
|
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
|
-
Home-page: https://github.com/WulfgarW/pycupra
|
6
|
-
Author: WulfgarW
|
7
|
-
License: APACHE-2.0
|
8
|
-
Provides: pycupra
|
9
|
-
Description-Content-Type: text/markdown
|
10
|
-
License-File: LICENSE
|
11
|
-
Requires-Dist: aiohttp
|
12
|
-
Requires-Dist: beautifulsoup4
|
13
|
-
Requires-Dist: cryptography
|
14
|
-
Requires-Dist: lxml
|
15
|
-
Requires-Dist: PyJWT
|
16
|
-
Requires-Dist: xmltodict
|
17
|
-
Dynamic: author
|
18
|
-
Dynamic: description
|
19
|
-
Dynamic: description-content-type
|
20
|
-
Dynamic: home-page
|
21
|
-
Dynamic: license-file
|
22
|
-
Dynamic: provides
|
23
|
-
Dynamic: requires-dist
|
24
|
-
Dynamic: summary
|
25
|
-
|
26
|
-
# PyCupra
|
27
|
-
|
28
|
-
A library to read and send vehicle data via Cupra/Seat portal using the same API calls as the MyCupra/MySeat mobile app.
|
29
|
-
|
30
|
-
Fork of https://github.com/Farfar/seatconnect which in turn is a fork of:
|
31
|
-
Fork of https://github.com/lendy007/skodaconnect which in turn is a fork of:
|
32
|
-
https://github.com/robinostlund/volkswagencarnet
|
33
|
-
|
34
|
-
## Information
|
35
|
-
|
36
|
-
Retrieve statistics about your Cupra/Seat from the Cupra/Seat Connect online service
|
37
|
-
|
38
|
-
No licence, public domain, no guarantees, feel free to use for anything. Please contribute improvements/bugfixes etc.
|
39
|
-
|
40
|
-
## Breaking changes
|
41
|
-
|
42
|
-
- The method vehicle.update(updateType) supports 3 different update types:
|
43
|
-
- 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.
|
44
|
-
- updateType=1: Full update (nearly all get-methods are called. The model images and the capabilitites are refreshed only every 2 hours.)
|
45
|
-
- updateType=2: Like updateType=0, but ignoring the nightly update reduction
|
46
|
-
|
47
|
-
- 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.
|
48
|
-
|
49
|
-
- 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 ....
|
50
|
-
|
51
|
-
## Thanks to
|
52
|
-
|
53
|
-
- [RobinostLund](https://github.com/robinostlund/volkswagencarnet) for initial project for Volkswagen Carnet I was able to fork
|
54
|
-
- [Farfar](https://github.com/Farfar) for modifications related to electric engines
|
55
|
-
- [tanelvakker](https://github.com/tanelvakker) for modifications related to correct SPIN handling for various actions and using correct URLs also for MY2021
|
56
|
-
- [sdb9696](https://github.com/sdb9696) for the firebase-messaging package that is used in PyCupra with only minor modifications
|
57
|
-
|
58
|
-
### Example
|
59
|
-
|
60
|
-
For an extensive example, please use the code found in example/PyCupra.py.
|
61
|
-
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.
|
62
|
-
Method get_vehicles will fetch vehicle basic information and create Vehicle class objects for all associated vehicles in account.
|
63
|
-
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.
|
64
|
-
|
65
|
-
The file *pycupra_credentials.json.demo* explains the data structure of the credentials file.
|
66
|
-
|
67
|
-
|
File without changes
|
File without changes
|