tesla-fleet-api 0.0.8 → 0.0.9
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.
- package/dist/energyspecific.js +10 -32
- package/dist/energyspecific.js.map +1 -1
- package/dist/vehicle.js +1 -1
- package/dist/vehicle.js.map +1 -1
- package/dist/vehiclespecific.d.ts +4 -15
- package/dist/vehiclespecific.js +91 -148
- package/dist/vehiclespecific.js.map +1 -1
- package/package.json +1 -1
- package/src/energyspecific.ts +10 -32
- package/src/vehicle.ts +1 -1
- package/src/vehiclespecific.ts +94 -142
package/dist/vehiclespecific.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ClimateModes, Seats } from "./types.js";
|
|
2
1
|
export default class VehicleSpecific {
|
|
3
2
|
constructor(parent, vin) {
|
|
4
3
|
this.parent = parent;
|
|
@@ -12,147 +11,147 @@ export default class VehicleSpecific {
|
|
|
12
11
|
* @param which_trunk "front" or "rear"
|
|
13
12
|
*/
|
|
14
13
|
async actuate_truck(which_trunk) {
|
|
15
|
-
return this.parent.
|
|
14
|
+
return this.parent.actuate_truck(this.vin, which_trunk);
|
|
16
15
|
}
|
|
17
16
|
/**
|
|
18
17
|
* Adjusts vehicle media playback volume.
|
|
19
18
|
* @param volume A floating point number from 0.0 to 11.0.
|
|
20
19
|
*/
|
|
21
20
|
async adjust_volume(volume) {
|
|
22
|
-
return this.parent.
|
|
21
|
+
return this.parent.adjust_volume(this.vin, volume);
|
|
23
22
|
}
|
|
24
23
|
/**
|
|
25
24
|
* Starts climate preconditioning.
|
|
26
25
|
*/
|
|
27
26
|
async auto_conditioning_start() {
|
|
28
|
-
return this.parent.
|
|
27
|
+
return this.parent.auto_conditioning_start(this.vin);
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
30
|
* Stops climate preconditioning.
|
|
32
31
|
*/
|
|
33
32
|
async auto_conditioning_stop() {
|
|
34
|
-
return this.parent.
|
|
33
|
+
return this.parent.auto_conditioning_stop(this.vin);
|
|
35
34
|
}
|
|
36
35
|
/**
|
|
37
36
|
* Cancels the countdown to install the vehicle software update.
|
|
38
37
|
*/
|
|
39
38
|
async cancel_software_update() {
|
|
40
|
-
return this.parent.
|
|
39
|
+
return this.parent.cancel_software_update(this.vin);
|
|
41
40
|
}
|
|
42
41
|
/**
|
|
43
42
|
* Charges in max range mode -- we recommend limiting the use of this mode to long trips.
|
|
44
43
|
*/
|
|
45
44
|
async charge_max_range() {
|
|
46
|
-
return this.parent.
|
|
45
|
+
return this.parent.charge_max_range(this.vin);
|
|
47
46
|
}
|
|
48
47
|
/**
|
|
49
48
|
* Closes the charge port door.
|
|
50
49
|
*/
|
|
51
50
|
async charge_port_door_close() {
|
|
52
|
-
return this.parent.
|
|
51
|
+
return this.parent.charge_port_door_close(this.vin);
|
|
53
52
|
}
|
|
54
53
|
/**
|
|
55
54
|
* Opens the charge port door.
|
|
56
55
|
*/
|
|
57
56
|
async charge_port_door_open() {
|
|
58
|
-
return this.parent.
|
|
57
|
+
return this.parent.charge_port_door_open(this.vin);
|
|
59
58
|
}
|
|
60
59
|
/**
|
|
61
60
|
* Charges in Standard mode.
|
|
62
61
|
*/
|
|
63
62
|
async charge_standard() {
|
|
64
|
-
return this.parent.
|
|
63
|
+
return this.parent.charge_standard(this.vin);
|
|
65
64
|
}
|
|
66
65
|
/**
|
|
67
66
|
* Starts charging the vehicle.
|
|
68
67
|
*/
|
|
69
68
|
async charge_start() {
|
|
70
|
-
return this.parent.
|
|
69
|
+
return this.parent.charge_start(this.vin);
|
|
71
70
|
}
|
|
72
71
|
/**
|
|
73
72
|
* Stops charging the vehicle.
|
|
74
73
|
*/
|
|
75
74
|
async charge_stop() {
|
|
76
|
-
return this.parent.
|
|
75
|
+
return this.parent.charge_stop(this.vin);
|
|
77
76
|
}
|
|
78
77
|
/**
|
|
79
78
|
* Deactivates PIN to Drive and resets the associated PIN for vehicles running firmware versions 2023.44+. This command is only accessible to fleet managers or owners.
|
|
80
79
|
*/
|
|
81
80
|
async clear_pin_to_drive_admin() {
|
|
82
|
-
return this.parent.
|
|
81
|
+
return this.parent.clear_pin_to_drive_admin(this.vin);
|
|
83
82
|
}
|
|
84
83
|
/**
|
|
85
84
|
* Locks the vehicle.
|
|
86
85
|
*/
|
|
87
86
|
async door_lock() {
|
|
88
|
-
return this.parent.
|
|
87
|
+
return this.parent.door_lock(this.vin);
|
|
89
88
|
}
|
|
90
89
|
/**
|
|
91
90
|
* Unlocks the vehicle.
|
|
92
91
|
*/
|
|
93
92
|
async door_unlock() {
|
|
94
|
-
return this.parent.
|
|
93
|
+
return this.parent.door_unlock(this.vin);
|
|
95
94
|
}
|
|
96
95
|
/**
|
|
97
96
|
* Erases user's data from the user interface. Requires the vehicle to be in park.
|
|
98
97
|
*/
|
|
99
98
|
async erase_user_data() {
|
|
100
|
-
return this.parent.
|
|
99
|
+
return this.parent.erase_user_data(this.vin);
|
|
101
100
|
}
|
|
102
101
|
/**
|
|
103
102
|
* Briefly flashes the vehicle headlights. Requires the vehicle to be in park.
|
|
104
103
|
*/
|
|
105
104
|
async flash_lights() {
|
|
106
|
-
return this.parent.
|
|
105
|
+
return this.parent.flash_lights(this.vin);
|
|
107
106
|
}
|
|
108
107
|
/**
|
|
109
108
|
* Restricts certain vehicle UI functionality from guest users
|
|
110
109
|
* @param enable `true` or `false`
|
|
111
110
|
*/
|
|
112
111
|
async guest_mode(enable) {
|
|
113
|
-
return this.parent.
|
|
112
|
+
return this.parent.guest_mode(this.vin, enable);
|
|
114
113
|
}
|
|
115
114
|
/**
|
|
116
115
|
* Honks the vehicle horn. Requires the vehicle to be in park.
|
|
117
116
|
*/
|
|
118
117
|
async honk_horn() {
|
|
119
|
-
return this.parent.
|
|
118
|
+
return this.parent.honk_horn(this.vin);
|
|
120
119
|
}
|
|
121
120
|
/**
|
|
122
121
|
* Advances media player to next favorite track.
|
|
123
122
|
*/
|
|
124
123
|
async media_next_fav() {
|
|
125
|
-
return this.parent.
|
|
124
|
+
return this.parent.media_next_fav(this.vin);
|
|
126
125
|
}
|
|
127
126
|
/**
|
|
128
127
|
* Advances media player to next track.
|
|
129
128
|
*/
|
|
130
129
|
async media_next_track() {
|
|
131
|
-
return this.parent.
|
|
130
|
+
return this.parent.media_next_track(this.vin);
|
|
132
131
|
}
|
|
133
132
|
/**
|
|
134
133
|
* Advances media player to previous favorite track.
|
|
135
134
|
*/
|
|
136
135
|
async media_prev_fav() {
|
|
137
|
-
return this.parent.
|
|
136
|
+
return this.parent.media_prev_fav(this.vin);
|
|
138
137
|
}
|
|
139
138
|
/**
|
|
140
139
|
* Advances media player to previous track.
|
|
141
140
|
*/
|
|
142
141
|
async media_prev_track() {
|
|
143
|
-
return this.parent.
|
|
142
|
+
return this.parent.media_prev_track(this.vin);
|
|
144
143
|
}
|
|
145
144
|
/**
|
|
146
145
|
* Toggles current play/pause state.
|
|
147
146
|
*/
|
|
148
147
|
async media_toggle_playback() {
|
|
149
|
-
return this.parent.
|
|
148
|
+
return this.parent.media_toggle_playback(this.vin);
|
|
150
149
|
}
|
|
151
150
|
/**
|
|
152
151
|
* Turns the volume down by one.
|
|
153
152
|
*/
|
|
154
153
|
async media_volume_down() {
|
|
155
|
-
return this.parent.
|
|
154
|
+
return this.parent.media_volume_down(this.vin);
|
|
156
155
|
}
|
|
157
156
|
/**
|
|
158
157
|
* Start navigation to given coordinates. Order can be used to specify order of multiple stops.
|
|
@@ -161,7 +160,7 @@ export default class VehicleSpecific {
|
|
|
161
160
|
* @param order Order of multiple stops
|
|
162
161
|
*/
|
|
163
162
|
async navigation_gps_request(lat, lon, order) {
|
|
164
|
-
return this.parent.
|
|
163
|
+
return this.parent.navigation_gps_request(this.vin, lat, lon, order);
|
|
165
164
|
}
|
|
166
165
|
/**
|
|
167
166
|
* Sends a location to the in-vehicle navigation system.
|
|
@@ -170,14 +169,7 @@ export default class VehicleSpecific {
|
|
|
170
169
|
* @param timestamp_ms
|
|
171
170
|
*/
|
|
172
171
|
async navigation_request(value, locale, type = "share_ext_content_raw") {
|
|
173
|
-
return this.parent.
|
|
174
|
-
type,
|
|
175
|
-
locale,
|
|
176
|
-
timestamp_ms: String(Date.now()),
|
|
177
|
-
value: {
|
|
178
|
-
"android.intent.extra.TEXT": value,
|
|
179
|
-
},
|
|
180
|
-
});
|
|
172
|
+
return this.parent.navigation_request(this.vin, value, locale, type);
|
|
181
173
|
}
|
|
182
174
|
/**
|
|
183
175
|
* Start navigation to a supercharger.
|
|
@@ -186,7 +178,7 @@ export default class VehicleSpecific {
|
|
|
186
178
|
* @returns
|
|
187
179
|
*/
|
|
188
180
|
async navigation_sc_request(id, order) {
|
|
189
|
-
return this.parent.
|
|
181
|
+
return this.parent.navigation_sc_request(this.vin, id, order);
|
|
190
182
|
}
|
|
191
183
|
/**
|
|
192
184
|
* Sets automatic seat heating and cooling.
|
|
@@ -194,27 +186,21 @@ export default class VehicleSpecific {
|
|
|
194
186
|
* @param auto_climate_on `true` or `false`
|
|
195
187
|
*/
|
|
196
188
|
async remote_auto_seat_climate_request(auto_seat_position, auto_climate_on) {
|
|
197
|
-
|
|
198
|
-
auto_seat_position = Seats[auto_seat_position];
|
|
199
|
-
}
|
|
200
|
-
return this.parent.parent._request("POST", `api/1/vehicles/${this.vin}/command/remote_auto_seat_climate_request`, null, {
|
|
201
|
-
auto_seat_position,
|
|
202
|
-
auto_climate_on,
|
|
203
|
-
});
|
|
189
|
+
return this.parent.remote_auto_seat_climate_request(this.vin, auto_seat_position, auto_climate_on);
|
|
204
190
|
}
|
|
205
191
|
/**
|
|
206
192
|
* Sets automatic steering wheel heating on/off.
|
|
207
193
|
* @param on `true` or `false`
|
|
208
194
|
*/
|
|
209
195
|
async remote_auto_steering_wheel_heat_climate_request(on) {
|
|
210
|
-
return this.parent.
|
|
196
|
+
return this.parent.remote_auto_steering_wheel_heat_climate_request(this.vin, on);
|
|
211
197
|
}
|
|
212
198
|
/**
|
|
213
199
|
* Plays a sound through the vehicle external speaker.
|
|
214
200
|
* @param sound Fart is `0`, Locate ping is `2000`
|
|
215
201
|
*/
|
|
216
202
|
async remote_boombox(sound = 0) {
|
|
217
|
-
return this.parent.
|
|
203
|
+
return this.parent.remote_boombox(this.vin, sound);
|
|
218
204
|
}
|
|
219
205
|
/**
|
|
220
206
|
* Sets seat cooling.
|
|
@@ -222,13 +208,7 @@ export default class VehicleSpecific {
|
|
|
222
208
|
* @param seat_cooler_level Cooling level
|
|
223
209
|
*/
|
|
224
210
|
async remote_seat_cooler_request(seat_position, seat_cooler_level) {
|
|
225
|
-
|
|
226
|
-
seat_position = Seats[seat_position];
|
|
227
|
-
}
|
|
228
|
-
return this.parent.parent._request("POST", `api/1/vehicles/${this.vin}/command/remote_seat_cooler_request`, null, {
|
|
229
|
-
seat_position,
|
|
230
|
-
seat_cooler_level,
|
|
231
|
-
});
|
|
211
|
+
return this.parent.remote_seat_cooler_request(this.vin, seat_position, seat_cooler_level);
|
|
232
212
|
}
|
|
233
213
|
/**
|
|
234
214
|
* Sets seat heating.
|
|
@@ -236,52 +216,46 @@ export default class VehicleSpecific {
|
|
|
236
216
|
* @param seat_heater_level Heating level
|
|
237
217
|
*/
|
|
238
218
|
async remote_seat_heater_request(seat_position, seat_heater_level) {
|
|
239
|
-
|
|
240
|
-
seat_position = Seats[seat_position];
|
|
241
|
-
}
|
|
242
|
-
return this.parent.parent._request("POST", `api/1/vehicles/${this.vin}/command/remote_seat_heater_request`, null, {
|
|
243
|
-
seat_position,
|
|
244
|
-
seat_heater_level,
|
|
245
|
-
});
|
|
219
|
+
return this.parent.remote_seat_heater_request(this.vin, seat_position, seat_heater_level);
|
|
246
220
|
}
|
|
247
221
|
/**
|
|
248
222
|
* Starts the vehicle remotely. Requires keyless driving to be enabled.
|
|
249
223
|
*/
|
|
250
224
|
async remote_start_drive() {
|
|
251
|
-
return this.parent.
|
|
225
|
+
return this.parent.remote_start_drive(this.vin);
|
|
252
226
|
}
|
|
253
227
|
/**
|
|
254
228
|
* Sets steering wheel heat level.
|
|
255
229
|
* @param level Heating level
|
|
256
230
|
*/
|
|
257
231
|
async remote_steering_wheel_heat_level_request(level) {
|
|
258
|
-
return this.parent.
|
|
232
|
+
return this.parent.remote_steering_wheel_heat_level_request(this.vin, level);
|
|
259
233
|
}
|
|
260
234
|
/**
|
|
261
235
|
* Sets steering wheel heating on/off. For vehicles that do not support auto steering wheel heat.
|
|
262
236
|
* @param on `true` or `false`
|
|
263
237
|
*/
|
|
264
238
|
async remote_steering_wheel_heater_request(on) {
|
|
265
|
-
return this.parent.
|
|
239
|
+
return this.parent.remote_steering_wheel_heater_request(this.vin, on);
|
|
266
240
|
}
|
|
267
241
|
/**
|
|
268
242
|
* Removes PIN to Drive. Requires the car to be in Pin to Drive mode and not in Valet mode. Note that this only works if PIN to Drive is not active. This command also requires the Tesla Vehicle Command Protocol - for more information, please see refer to the documentation here.
|
|
269
243
|
*/
|
|
270
244
|
async reset_pin_to_drive_pin() {
|
|
271
|
-
return this.parent.
|
|
245
|
+
return this.parent.reset_pin_to_drive_pin(this.vin);
|
|
272
246
|
}
|
|
273
247
|
/**
|
|
274
248
|
* Removes PIN for Valet Mode.
|
|
275
249
|
*/
|
|
276
250
|
async reset_valet_pin() {
|
|
277
|
-
return this.parent.
|
|
251
|
+
return this.parent.reset_valet_pin(this.vin);
|
|
278
252
|
}
|
|
279
253
|
/**
|
|
280
254
|
* Schedules a vehicle software update (over the air "OTA") to be installed in the future.
|
|
281
255
|
* @param offset_sec Offset in seconds
|
|
282
256
|
*/
|
|
283
257
|
async schedule_software_update(offset_sec) {
|
|
284
|
-
return this.parent.
|
|
258
|
+
return this.parent.schedule_software_update(this.vin, offset_sec);
|
|
285
259
|
}
|
|
286
260
|
/**
|
|
287
261
|
* Turns Bioweapon Defense Mode on and off.
|
|
@@ -289,7 +263,7 @@ export default class VehicleSpecific {
|
|
|
289
263
|
* @param manual_override `true` or `false`
|
|
290
264
|
*/
|
|
291
265
|
async set_bioweapon_mode(on, manual_override) {
|
|
292
|
-
return this.parent.
|
|
266
|
+
return this.parent.set_bioweapon_mode(this.vin, on, manual_override);
|
|
293
267
|
}
|
|
294
268
|
/**
|
|
295
269
|
* Sets the vehicle overheat protection.
|
|
@@ -297,44 +271,35 @@ export default class VehicleSpecific {
|
|
|
297
271
|
* @param fan_only `true` or `false`
|
|
298
272
|
*/
|
|
299
273
|
async set_cabin_overheat_protection(on, fan_only) {
|
|
300
|
-
return this.parent.
|
|
274
|
+
return this.parent.set_cabin_overheat_protection(this.vin, on, fan_only);
|
|
301
275
|
}
|
|
302
276
|
/**
|
|
303
277
|
* Sets the vehicle's charge limit to a custom percentage.
|
|
304
278
|
* @param percent Charge limit percentage typically between 50-100
|
|
305
279
|
*/
|
|
306
280
|
async set_charge_limit(percent) {
|
|
307
|
-
return this.parent.
|
|
281
|
+
return this.parent.set_charge_limit(this.vin, percent);
|
|
308
282
|
}
|
|
309
283
|
/**
|
|
310
284
|
* Sets the charge limit to the standard setting.
|
|
311
285
|
* @param percent Current limit in Amps typically between 5-32
|
|
312
286
|
*/
|
|
313
287
|
async set_charging_amps(charging_amps) {
|
|
314
|
-
return this.parent.
|
|
288
|
+
return this.parent.set_charging_amps(this.vin, charging_amps);
|
|
315
289
|
}
|
|
316
290
|
/**
|
|
317
291
|
* Enables climate keeper mode.
|
|
318
292
|
* @param climate_keeper_mode `0` is Off, `1` is Keep, `2` is Dog, `3` is Camp
|
|
319
293
|
*/
|
|
320
294
|
async set_climate_keeper_mode(climate_keeper_mode) {
|
|
321
|
-
|
|
322
|
-
climate_keeper_mode = ClimateModes[climate_keeper_mode];
|
|
323
|
-
}
|
|
324
|
-
return this.parent.parent._request("POST", `api/1/vehicles/${this.vin}/command/set_climate_keeper_mode`, null, { climate_keeper_mode });
|
|
295
|
+
return this.parent.set_climate_keeper_mode(this.vin, climate_keeper_mode);
|
|
325
296
|
}
|
|
326
297
|
/**
|
|
327
298
|
* Adjusts the Cabin Overheat Protection temperature (COP).
|
|
328
299
|
* @param cop_temp Integer representing Low (0/30C/90F), Medium (1/35C/95F), or High (2/40C/100F)
|
|
329
300
|
*/
|
|
330
301
|
async set_cop_temp(cop_temp) {
|
|
331
|
-
|
|
332
|
-
cop_temp = (cop_temp - 90) / 5;
|
|
333
|
-
}
|
|
334
|
-
else if (cop_temp >= 30) {
|
|
335
|
-
cop_temp = (cop_temp - 30) / 5;
|
|
336
|
-
}
|
|
337
|
-
return this.parent.parent._request("POST", `api/1/vehicles/${this.vin}/command/set_cop_temp`, null, { cop_temp });
|
|
302
|
+
return this.parent.set_cop_temp(this.vin, cop_temp);
|
|
338
303
|
}
|
|
339
304
|
/**
|
|
340
305
|
* Sets a four-digit passcode for PIN to Drive. This PIN must then be entered before the vehicle can be driven.
|
|
@@ -342,7 +307,7 @@ export default class VehicleSpecific {
|
|
|
342
307
|
* @param password Four-digit passcode
|
|
343
308
|
*/
|
|
344
309
|
async set_pin_to_drive(on, password) {
|
|
345
|
-
return this.parent.
|
|
310
|
+
return this.parent.set_pin_to_drive(this.vin, on, password);
|
|
346
311
|
}
|
|
347
312
|
/**
|
|
348
313
|
* Sets an override for preconditioning — it should default to empty if no override is used.
|
|
@@ -351,7 +316,7 @@ export default class VehicleSpecific {
|
|
|
351
316
|
* @param manual_override `true` or `false`
|
|
352
317
|
*/
|
|
353
318
|
async set_preconditioning_max(on, manual_override) {
|
|
354
|
-
return this.parent.
|
|
319
|
+
return this.parent.set_preconditioning_max(this.vin, on, manual_override);
|
|
355
320
|
}
|
|
356
321
|
/**
|
|
357
322
|
* Sets a time at which charging should be completed. The time parameter is minutes after midnight (e.g: time=120 schedules charging for 2:00am vehicle local time).
|
|
@@ -359,7 +324,7 @@ export default class VehicleSpecific {
|
|
|
359
324
|
* @param time Minutes after midnight
|
|
360
325
|
*/
|
|
361
326
|
async set_scheduled_charging(enable, time) {
|
|
362
|
-
return this.parent.
|
|
327
|
+
return this.parent.set_scheduled_charging(this.vin, enable, time);
|
|
363
328
|
}
|
|
364
329
|
/**
|
|
365
330
|
* Sets a time at which departure should be completed. The time parameter is minutes after midnight (e.g: time=120 schedules departure for 2:00am vehicle local time).
|
|
@@ -372,22 +337,14 @@ export default class VehicleSpecific {
|
|
|
372
337
|
* @param end_off_peak_time Minutes after midnight
|
|
373
338
|
*/
|
|
374
339
|
async set_scheduled_departure(enable = true, preconditioning_enabled = false, preconditioning_weekdays_only = false, departure_time = 0, off_peak_charging_enabled = false, off_peak_charging_weekdays_only = false, end_off_peak_time = 0) {
|
|
375
|
-
return this.parent.
|
|
376
|
-
enable,
|
|
377
|
-
preconditioning_enabled,
|
|
378
|
-
preconditioning_weekdays_only,
|
|
379
|
-
departure_time,
|
|
380
|
-
off_peak_charging_enabled,
|
|
381
|
-
off_peak_charging_weekdays_only,
|
|
382
|
-
end_off_peak_time,
|
|
383
|
-
});
|
|
340
|
+
return this.parent.set_scheduled_departure(this.vin, enable, preconditioning_enabled, preconditioning_weekdays_only, departure_time, off_peak_charging_enabled, off_peak_charging_weekdays_only, end_off_peak_time);
|
|
384
341
|
}
|
|
385
342
|
/**
|
|
386
343
|
* Enables and disables Sentry Mode. Sentry Mode allows customers to watch the vehicle cameras live from the mobile app, as well as record sentry events.
|
|
387
344
|
* @param on `true` or `false`
|
|
388
345
|
*/
|
|
389
346
|
async set_sentry_mode(on) {
|
|
390
|
-
return this.parent.
|
|
347
|
+
return this.parent.set_sentry_mode(this.vin, on);
|
|
391
348
|
}
|
|
392
349
|
/**
|
|
393
350
|
* Sets the driver and/or passenger-side cabin temperature (and other zones if sync is enabled).
|
|
@@ -395,7 +352,7 @@ export default class VehicleSpecific {
|
|
|
395
352
|
* @param passenger_temp Passenger temperature
|
|
396
353
|
*/
|
|
397
354
|
async set_temps(driver_temp, passenger_temp) {
|
|
398
|
-
return this.parent.
|
|
355
|
+
return this.parent.set_temps(this.vin, driver_temp, passenger_temp);
|
|
399
356
|
}
|
|
400
357
|
/**
|
|
401
358
|
* Turns on Valet Mode and sets a four-digit passcode that must then be entered to disable Valet Mode.
|
|
@@ -403,62 +360,62 @@ export default class VehicleSpecific {
|
|
|
403
360
|
* @param password Four-digit passcode
|
|
404
361
|
*/
|
|
405
362
|
async set_valet_mode(on, password) {
|
|
406
|
-
return this.parent.
|
|
363
|
+
return this.parent.set_valet_mode(this.vin, on, password);
|
|
407
364
|
}
|
|
408
365
|
/**
|
|
409
366
|
* Changes the name of a vehicle. This command also requires the Tesla Vehicle Command Protocol - for more information, please see refer to the documentation here.
|
|
410
367
|
* @param vehicle_name New name
|
|
411
368
|
*/
|
|
412
369
|
async set_vehicle_name(vehicle_name) {
|
|
413
|
-
return this.parent.
|
|
370
|
+
return this.parent.set_vehicle_name(this.vin, vehicle_name);
|
|
414
371
|
}
|
|
415
372
|
/**
|
|
416
373
|
* Activates Speed Limit Mode with a four-digit PIN.
|
|
417
374
|
* @param pin Four-digit PIN
|
|
418
375
|
*/
|
|
419
376
|
async speed_limit_activate(pin) {
|
|
420
|
-
return this.parent.
|
|
377
|
+
return this.parent.speed_limit_activate(this.vin, pin);
|
|
421
378
|
}
|
|
422
379
|
/**
|
|
423
380
|
* Deactivates Speed Limit Mode and resets the associated PIN.
|
|
424
381
|
* @param pin Four-digit PIN
|
|
425
382
|
*/
|
|
426
383
|
async speed_limit_clear_pin(pin) {
|
|
427
|
-
return this.parent.
|
|
384
|
+
return this.parent.speed_limit_clear_pin(this.vin, pin);
|
|
428
385
|
}
|
|
429
386
|
/**
|
|
430
387
|
* Deactivates Speed Limit Mode and resets the associated PIN for vehicles running firmware versions 2023.38+. This command is only accessible to fleet managers or owners.
|
|
431
388
|
*/
|
|
432
389
|
async speed_limit_clear_pin_admin() {
|
|
433
|
-
return this.parent.
|
|
390
|
+
return this.parent.speed_limit_clear_pin_admin(this.vin);
|
|
434
391
|
}
|
|
435
392
|
/**
|
|
436
393
|
* Deactivates Speed Limit Mode.
|
|
437
394
|
* @param pin Four-digit PIN
|
|
438
395
|
*/
|
|
439
396
|
async speed_limit_deactivate(pin) {
|
|
440
|
-
return this.parent.
|
|
397
|
+
return this.parent.speed_limit_deactivate(this.vin, pin);
|
|
441
398
|
}
|
|
442
399
|
/**
|
|
443
400
|
* Sets the maximum speed allowed when Speed Limit Mode is active.
|
|
444
401
|
* @param limit_mph Maximum speed in MPH
|
|
445
402
|
*/
|
|
446
403
|
async speed_limit_set_limit(limit_mph) {
|
|
447
|
-
return this.parent.
|
|
404
|
+
return this.parent.speed_limit_set_limit(this.vin, limit_mph);
|
|
448
405
|
}
|
|
449
406
|
/**
|
|
450
407
|
* Controls the panoramic sunroof on the Model S.
|
|
451
408
|
* @param state "stop", "close" or "vent"
|
|
452
409
|
*/
|
|
453
410
|
async sun_roof_control(state) {
|
|
454
|
-
return this.parent.
|
|
411
|
+
return this.parent.sun_roof_control(this.vin, state);
|
|
455
412
|
}
|
|
456
413
|
/**
|
|
457
414
|
* Records a drive note. The note parameter is truncated to 80 characters in length.
|
|
458
415
|
* @param note Drive note
|
|
459
416
|
*/
|
|
460
417
|
async take_drivenote(note) {
|
|
461
|
-
return this.parent.
|
|
418
|
+
return this.parent.take_drivenote(this.vin, note);
|
|
462
419
|
}
|
|
463
420
|
/**
|
|
464
421
|
* Turns on HomeLink (used to open and close garage doors).
|
|
@@ -467,14 +424,14 @@ export default class VehicleSpecific {
|
|
|
467
424
|
* @param lon Longitude
|
|
468
425
|
*/
|
|
469
426
|
async trigger_homelink(lat, lon, token) {
|
|
470
|
-
return this.parent.
|
|
427
|
+
return this.parent.trigger_homelink(this.vin, lat, lon, token);
|
|
471
428
|
}
|
|
472
429
|
/**
|
|
473
430
|
* Upcoming calendar entries stored on the vehicle.
|
|
474
431
|
* @param calendar_data Calendar data
|
|
475
432
|
*/
|
|
476
433
|
async upcoming_calendar_entries(calendar_data) {
|
|
477
|
-
return this.parent.
|
|
434
|
+
return this.parent.upcoming_calendar_entries(this.vin, calendar_data);
|
|
478
435
|
}
|
|
479
436
|
/**
|
|
480
437
|
* Control the windows of a parked vehicle. Supported commands: vent and close. When closing, specify lat and lon of user to ensure they are within range of vehicle (unless this is an M3 platform vehicle).
|
|
@@ -483,43 +440,43 @@ export default class VehicleSpecific {
|
|
|
483
440
|
* @param lon Longitude
|
|
484
441
|
*/
|
|
485
442
|
async window_control(command, lat, lon) {
|
|
486
|
-
return this.parent.
|
|
443
|
+
return this.parent.window_control(this.vin, command, lat, lon);
|
|
487
444
|
}
|
|
488
445
|
// Vehicle Endpoints
|
|
489
446
|
/**
|
|
490
447
|
* Returns all allowed drivers for a vehicle. This endpoint is only available for the vehicle owner.
|
|
491
448
|
*/
|
|
492
449
|
async drivers() {
|
|
493
|
-
return this.parent.
|
|
450
|
+
return this.parent.drivers(this.vin);
|
|
494
451
|
}
|
|
495
452
|
/**
|
|
496
453
|
* Removes driver access from a vehicle. Share users can only remove their own access. Owners can remove share access or their own.
|
|
497
454
|
* @param share_user_id
|
|
498
455
|
*/
|
|
499
456
|
async drivers_remove(share_user_id) {
|
|
500
|
-
return this.parent.
|
|
457
|
+
return this.parent.drivers_remove(this.vin, share_user_id);
|
|
501
458
|
}
|
|
502
459
|
/**
|
|
503
460
|
* Returns eligible vehicle subscriptions.
|
|
504
461
|
* @param vin Vehicle Identification Number
|
|
505
462
|
*/
|
|
506
|
-
async eligible_subscriptions(
|
|
507
|
-
return this.parent.
|
|
463
|
+
async eligible_subscriptions() {
|
|
464
|
+
return this.parent.eligible_subscriptions(this.vin);
|
|
508
465
|
}
|
|
509
466
|
/**
|
|
510
467
|
* Returns eligibile vehicle upgrades.
|
|
511
468
|
* @param vin Vehicle Identification Number
|
|
512
469
|
*/
|
|
513
|
-
async eligible_upgrades(
|
|
514
|
-
return this.parent.
|
|
470
|
+
async eligible_upgrades() {
|
|
471
|
+
return this.parent.eligible_upgrades(this.vin);
|
|
515
472
|
}
|
|
516
473
|
/**
|
|
517
474
|
* Checks whether vehicles can accept Tesla commands protocol for the partner's public key
|
|
518
475
|
* @param vins list of Vehicle Identification Number
|
|
519
476
|
* @returns
|
|
520
477
|
*/
|
|
521
|
-
async fleet_status(
|
|
522
|
-
return this.parent.
|
|
478
|
+
async fleet_status() {
|
|
479
|
+
return this.parent.fleet_status([this.vin]);
|
|
523
480
|
}
|
|
524
481
|
/**
|
|
525
482
|
* Configures vehicles to connect to self-hosted fleet-telemetry server. This endpoint has concurrency 1 (status 429 will be returned if many calls are made at the same time). Multiple vehicles can be configured with a single call.
|
|
@@ -527,35 +484,30 @@ export default class VehicleSpecific {
|
|
|
527
484
|
* @returns
|
|
528
485
|
*/
|
|
529
486
|
async fleet_telemetry_config(config) {
|
|
530
|
-
return this.parent.
|
|
487
|
+
return this.parent.fleet_telemetry_config({
|
|
488
|
+
vins: [this.vin],
|
|
489
|
+
config,
|
|
490
|
+
});
|
|
531
491
|
}
|
|
532
492
|
/**
|
|
533
493
|
* Disconnects vehicles to stream telemetry data to self hosted fleet-telemetry server.
|
|
534
494
|
* @returns
|
|
535
495
|
*/
|
|
536
496
|
async fleet_telemetry_config_delete() {
|
|
537
|
-
return this.parent.
|
|
497
|
+
return this.parent.fleet_telemetry_config_delete(this.vin);
|
|
538
498
|
}
|
|
539
499
|
/**
|
|
540
500
|
* Fetches a vehicle's fleet telemetry config. synced set to true means the vehicle has adopted the target config. synced set to false means the vehicle will attempt to adopt the target config when it next establishes a backend connection.
|
|
541
501
|
* @returns
|
|
542
502
|
*/
|
|
543
503
|
async fleet_telemetry_config_get() {
|
|
544
|
-
return this.parent.
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* Create a Vehicle class for a specific vehicle.
|
|
548
|
-
* @param page Page number
|
|
549
|
-
* @param per_page Number of items per page
|
|
550
|
-
*/
|
|
551
|
-
async list(page, per_page) {
|
|
552
|
-
return this.parent.parent._request("GET", "api/1/vehicles", { page, per_page });
|
|
504
|
+
return this.parent.fleet_telemetry_config_get(this.vin);
|
|
553
505
|
}
|
|
554
506
|
/**
|
|
555
507
|
* Returns whether or not mobile access is enabled for the vehicle.
|
|
556
508
|
*/
|
|
557
509
|
async mobile_enabled() {
|
|
558
|
-
return this.parent.
|
|
510
|
+
return this.parent.mobile_enabled(this.vin);
|
|
559
511
|
}
|
|
560
512
|
/**
|
|
561
513
|
* Returns the charging sites near the current location of the vehicle.
|
|
@@ -564,20 +516,20 @@ export default class VehicleSpecific {
|
|
|
564
516
|
* @param detail
|
|
565
517
|
*/
|
|
566
518
|
async nearby_charging_sites(count, radius, detail) {
|
|
567
|
-
return this.parent.
|
|
519
|
+
return this.parent.nearby_charging_sites(this.vin, count, radius, detail);
|
|
568
520
|
}
|
|
569
521
|
/**
|
|
570
522
|
* Returns vehicle option details.
|
|
571
523
|
* @param vin Vehicle Identification Number
|
|
572
524
|
*/
|
|
573
525
|
async options(vin) {
|
|
574
|
-
return this.parent.
|
|
526
|
+
return this.parent.options(this.vin);
|
|
575
527
|
}
|
|
576
528
|
/**
|
|
577
529
|
* List of recent alerts
|
|
578
530
|
*/
|
|
579
531
|
async recent_alerts() {
|
|
580
|
-
return this.parent.
|
|
532
|
+
return this.parent.recent_alerts(this.vin);
|
|
581
533
|
}
|
|
582
534
|
/**
|
|
583
535
|
* Returns firmware release notes.
|
|
@@ -585,74 +537,65 @@ export default class VehicleSpecific {
|
|
|
585
537
|
* @param language
|
|
586
538
|
*/
|
|
587
539
|
async release_notes(staged, language) {
|
|
588
|
-
return this.parent.
|
|
540
|
+
return this.parent.release_notes(this.vin, staged, language);
|
|
589
541
|
}
|
|
590
542
|
/**
|
|
591
543
|
* Returns service data.
|
|
592
544
|
*/
|
|
593
545
|
async service_data() {
|
|
594
|
-
return this.parent.
|
|
546
|
+
return this.parent.service_data(this.vin);
|
|
595
547
|
}
|
|
596
548
|
/**
|
|
597
549
|
* Returns the share invites for a vehicle.
|
|
598
550
|
*/
|
|
599
551
|
async share_invites() {
|
|
600
|
-
return this.parent.
|
|
552
|
+
return this.parent.share_invites(this.vin);
|
|
601
553
|
}
|
|
602
554
|
/**
|
|
603
555
|
* Creates a share invite for a vehicle.
|
|
604
556
|
*/
|
|
605
557
|
async share_invites_create() {
|
|
606
|
-
return this.parent.
|
|
607
|
-
}
|
|
608
|
-
/**
|
|
609
|
-
* Redeems a share invite.
|
|
610
|
-
* @param code
|
|
611
|
-
*/
|
|
612
|
-
async share_invites_redeem(code) {
|
|
613
|
-
return this.parent.parent._request("POST", "api/1/invitations/redeem", { code });
|
|
558
|
+
return this.parent.share_invites_create(this.vin);
|
|
614
559
|
}
|
|
615
560
|
/**
|
|
616
561
|
* Revokes a share invite.
|
|
617
562
|
* @param id
|
|
618
563
|
*/
|
|
619
564
|
async share_invites_revoke(id) {
|
|
620
|
-
return this.parent.
|
|
565
|
+
return this.parent.share_invites_revoke(this.vin, id);
|
|
621
566
|
}
|
|
622
567
|
/**
|
|
623
568
|
* Signed Commands is a generic endpoint replacing legacy commands.
|
|
624
569
|
* @param routable_message
|
|
625
570
|
*/
|
|
626
571
|
async signed_command(routable_message) {
|
|
627
|
-
return this.parent.
|
|
572
|
+
return this.parent.signed_command(this.vin, routable_message);
|
|
628
573
|
}
|
|
629
574
|
/**
|
|
630
575
|
* Returns information about a vehicle.
|
|
631
576
|
*/
|
|
632
577
|
async vehicle() {
|
|
633
|
-
return this.parent.
|
|
578
|
+
return this.parent.vehicle(this.vin);
|
|
634
579
|
}
|
|
635
580
|
/**
|
|
636
581
|
* Makes a live call to the vehicle. This may return cached data if the vehicle is offline. For vehicles running firmware versions 2023.38+, location_data is required to fetch vehicle location. This will result in a location sharing icon to show on the vehicle UI.
|
|
637
582
|
* @param endpoints
|
|
638
583
|
*/
|
|
639
584
|
async vehicle_data(endpoints) {
|
|
640
|
-
|
|
641
|
-
endpoints = endpoints.join(";");
|
|
642
|
-
return this.parent.parent._request("GET", `api/1/vehicles/${this.vin}/vehicle_data`, null, { endpoints });
|
|
585
|
+
return this.parent.vehicle_data(this.vin, endpoints);
|
|
643
586
|
}
|
|
644
587
|
/**
|
|
645
588
|
* Wakes the vehicle from sleep, which is a state to minimize idle energy consumption.
|
|
646
589
|
*/
|
|
647
590
|
async wake_up() {
|
|
648
|
-
return this.parent.
|
|
591
|
+
return this.parent.wake_up(this.vin);
|
|
649
592
|
}
|
|
650
593
|
/**
|
|
651
594
|
* Returns warranty details.
|
|
652
595
|
* @param vin
|
|
653
596
|
*/
|
|
654
|
-
async warranty_details(
|
|
655
|
-
return this.parent.
|
|
597
|
+
async warranty_details() {
|
|
598
|
+
return this.parent.warranty_details(this.vin);
|
|
656
599
|
}
|
|
657
600
|
}
|
|
658
601
|
//# sourceMappingURL=vehiclespecific.js.map
|