tesla-fleet-api 0.2.2 → 0.4.0
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/_virtual/_rolldown/runtime.cjs +22 -0
- package/dist/_virtual/_rolldown/runtime.mjs +12 -0
- package/dist/charging.cjs +53 -0
- package/dist/charging.d.cts +31 -0
- package/dist/charging.d.mts +30 -0
- package/dist/charging.mjs +53 -0
- package/dist/commands.cjs +802 -0
- package/dist/commands.d.cts +350 -0
- package/dist/commands.d.mts +349 -0
- package/dist/commands.mjs +800 -0
- package/dist/const.cjs +300 -0
- package/dist/const.d.cts +287 -0
- package/dist/const.d.mts +287 -0
- package/dist/const.mjs +263 -0
- package/dist/energy.cjs +137 -0
- package/dist/energy.d.cts +95 -0
- package/{src/energy.ts → dist/energy.d.mts} +17 -140
- package/dist/energy.mjs +137 -0
- package/dist/energyspecific.cjs +99 -0
- package/dist/energyspecific.d.cts +78 -0
- package/dist/energyspecific.d.mts +77 -0
- package/dist/energyspecific.mjs +99 -0
- package/dist/exceptions.cjs +1487 -0
- package/dist/exceptions.d.cts +1142 -0
- package/dist/exceptions.d.mts +1142 -0
- package/dist/exceptions.mjs +1324 -0
- package/dist/index.cjs +226 -0
- package/dist/index.d.cts +14 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.mjs +14 -0
- package/dist/partner.cjs +32 -0
- package/dist/partner.d.cts +24 -0
- package/dist/partner.d.mts +23 -0
- package/dist/partner.mjs +32 -0
- package/dist/router.cjs +0 -0
- package/dist/router.d.cts +1 -0
- package/dist/router.d.mts +1 -0
- package/dist/router.mjs +1 -0
- package/dist/signing/crypto.cjs +31 -0
- package/dist/signing/crypto.mjs +27 -0
- package/dist/signing/session.cjs +112 -0
- package/dist/signing/session.d.cts +69 -0
- package/dist/signing/session.d.mts +69 -0
- package/dist/signing/session.mjs +110 -0
- package/dist/tariff.cjs +292 -0
- package/dist/{tariff.d.ts → tariff.d.cts} +17 -17
- package/dist/tariff.d.mts +29 -0
- package/dist/tariff.mjs +291 -0
- package/dist/teslafleetapi.cjs +125 -0
- package/dist/teslafleetapi.d.cts +64 -0
- package/dist/teslafleetapi.d.mts +64 -0
- package/dist/teslafleetapi.mjs +125 -0
- package/dist/teslemetry.cjs +36 -0
- package/dist/teslemetry.d.cts +23 -0
- package/dist/teslemetry.d.mts +23 -0
- package/dist/teslemetry.mjs +36 -0
- package/dist/tessie.cjs +34 -0
- package/dist/tessie.d.cts +23 -0
- package/dist/tessie.d.mts +23 -0
- package/dist/tessie.mjs +34 -0
- package/dist/types/commands.d.cts +28 -0
- package/dist/types/commands.d.mts +28 -0
- package/dist/types/live_status.d.cts +30 -0
- package/dist/types/live_status.d.mts +30 -0
- package/dist/types/products.d.cts +58 -0
- package/dist/types/products.d.mts +58 -0
- package/dist/types/responses.d.cts +9 -0
- package/dist/types/responses.d.mts +9 -0
- package/dist/types/site_info.d.cts +154 -0
- package/dist/types/site_info.d.mts +154 -0
- package/dist/types/vehicle.d.cts +27 -0
- package/dist/types/vehicle.d.mts +27 -0
- package/dist/types/vehicle_data.d.cts +278 -0
- package/dist/types/vehicle_data.d.mts +278 -0
- package/dist/types.cjs +0 -0
- package/dist/types.d.cts +9 -0
- package/dist/types.d.mts +9 -0
- package/dist/types.mjs +1 -0
- package/dist/user.cjs +28 -0
- package/dist/user.d.cts +17 -0
- package/dist/user.d.mts +16 -0
- package/dist/user.mjs +28 -0
- package/dist/vehicle.cjs +804 -0
- package/dist/vehicle.d.cts +550 -0
- package/dist/vehicle.d.mts +549 -0
- package/dist/vehicle.mjs +804 -0
- package/dist/vehiclesigned.cjs +20 -0
- package/dist/vehiclesigned.d.cts +14 -0
- package/dist/{vehiclesigned.d.ts → vehiclesigned.d.mts} +3 -3
- package/dist/vehiclesigned.mjs +20 -0
- package/dist/vehiclespecific.cjs +604 -0
- package/dist/vehiclespecific.d.cts +433 -0
- package/dist/vehiclespecific.d.mts +432 -0
- package/dist/vehiclespecific.mjs +604 -0
- package/package.json +108 -35
- package/dist/charging.d.ts +0 -30
- package/dist/charging.js +0 -51
- package/dist/charging.js.map +0 -1
- package/dist/commands.d.ts +0 -352
- package/dist/commands.js +0 -875
- package/dist/commands.js.map +0 -1
- package/dist/energy.d.ts +0 -94
- package/dist/energy.js +0 -125
- package/dist/energy.js.map +0 -1
- package/dist/energyspecific.d.ts +0 -77
- package/dist/energyspecific.js +0 -97
- package/dist/energyspecific.js.map +0 -1
- package/dist/helpers.d.ts +0 -2
- package/dist/helpers.js +0 -10
- package/dist/helpers.js.map +0 -1
- package/dist/index.d.ts +0 -14
- package/dist/index.js +0 -14
- package/dist/index.js.map +0 -1
- package/dist/partner.d.ts +0 -23
- package/dist/partner.js +0 -31
- package/dist/partner.js.map +0 -1
- package/dist/signing/crypto.d.ts +0 -10
- package/dist/signing/crypto.js +0 -26
- package/dist/signing/crypto.js.map +0 -1
- package/dist/signing/errors.d.ts +0 -29
- package/dist/signing/errors.js +0 -40
- package/dist/signing/errors.js.map +0 -1
- package/dist/signing/session.d.ts +0 -69
- package/dist/signing/session.js +0 -102
- package/dist/signing/session.js.map +0 -1
- package/dist/tariff.js +0 -302
- package/dist/tariff.js.map +0 -1
- package/dist/teslafleetapi.d.ts +0 -58
- package/dist/teslafleetapi.js +0 -120
- package/dist/teslafleetapi.js.map +0 -1
- package/dist/teslemetry.d.ts +0 -29
- package/dist/teslemetry.js +0 -39
- package/dist/teslemetry.js.map +0 -1
- package/dist/tessie.d.ts +0 -23
- package/dist/tessie.js +0 -28
- package/dist/tessie.js.map +0 -1
- package/dist/types/commands.d.ts +0 -44
- package/dist/types/commands.js +0 -11
- package/dist/types/commands.js.map +0 -1
- package/dist/types/live_status.d.ts +0 -26
- package/dist/types/live_status.js +0 -2
- package/dist/types/live_status.js.map +0 -1
- package/dist/types/products.d.ts +0 -54
- package/dist/types/products.js +0 -2
- package/dist/types/products.js.map +0 -1
- package/dist/types/responses.d.ts +0 -5
- package/dist/types/responses.js +0 -2
- package/dist/types/responses.js.map +0 -1
- package/dist/types/site_info.d.ts +0 -150
- package/dist/types/site_info.js +0 -2
- package/dist/types/site_info.js.map +0 -1
- package/dist/types/vehicle.d.ts +0 -22
- package/dist/types/vehicle.js +0 -2
- package/dist/types/vehicle.js.map +0 -1
- package/dist/types/vehicle_data.d.ts +0 -274
- package/dist/types/vehicle_data.js +0 -2
- package/dist/types/vehicle_data.js.map +0 -1
- package/dist/user.d.ts +0 -16
- package/dist/user.js +0 -26
- package/dist/user.js.map +0 -1
- package/dist/vehicle.d.ts +0 -548
- package/dist/vehicle.js +0 -781
- package/dist/vehicle.js.map +0 -1
- package/dist/vehiclesigned.js +0 -19
- package/dist/vehiclesigned.js.map +0 -1
- package/dist/vehiclespecific.d.ts +0 -432
- package/dist/vehiclespecific.js +0 -601
- package/dist/vehiclespecific.js.map +0 -1
- package/src/charging.ts +0 -66
- package/src/commands.ts +0 -1134
- package/src/energyspecific.ts +0 -116
- package/src/helpers.ts +0 -11
- package/src/index.ts +0 -20
- package/src/partner.ts +0 -37
- package/src/signing/crypto.ts +0 -29
- package/src/signing/errors.ts +0 -50
- package/src/signing/session.ts +0 -132
- package/src/tariff.ts +0 -375
- package/src/teslafleetapi.ts +0 -182
- package/src/teslemetry.ts +0 -54
- package/src/tessie.ts +0 -42
- package/src/types/commands.ts +0 -62
- package/src/types/live_status.ts +0 -27
- package/src/types/products.ts +0 -61
- package/src/types/responses.ts +0 -1
- package/src/types/site_info.ts +0 -159
- package/src/types/vehicle.ts +0 -23
- package/src/types/vehicle_data.ts +0 -286
- package/src/user.ts +0 -35
- package/src/vehicle.ts +0 -895
- package/src/vehiclesigned.ts +0 -20
- package/src/vehiclespecific.ts +0 -818
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { CommandResponse } from "./types/commands.mjs";
|
|
2
|
+
import { AutoSeat, ClimateMode, Level, Seat, Trunk } from "./const.mjs";
|
|
3
|
+
import Vehicle from "./vehicle.mjs";
|
|
4
|
+
import VehicleSpecific from "./vehiclespecific.mjs";
|
|
5
|
+
import { RoutableMessage } from "@teslemetry/tesla-protocol/command/universal_message";
|
|
6
|
+
import { VehicleStatus } from "@teslemetry/tesla-protocol/command/vcsec";
|
|
7
|
+
/**
|
|
8
|
+
* Transport-agnostic signed-command builder for the Tesla Vehicle Command
|
|
9
|
+
* Protocol: mirrors `python-tesla-fleet-api`'s `Commands` ABC. Every method
|
|
10
|
+
* here builds a `RoutableMessage`, signs it (HMAC-personalized), and
|
|
11
|
+
* dispatches it through the single abstract seam `_send`. A concrete
|
|
12
|
+
* subclass fills that seam for one transport - the cloud `/signed_command`
|
|
13
|
+
* HTTP endpoint (`VehicleSigned`) today, a BLE GATT link in a future story.
|
|
14
|
+
*
|
|
15
|
+
* AES-GCM personalized signing (the BLE-only auth mode) is intentionally out
|
|
16
|
+
* of scope here; see AGENTS.md.
|
|
17
|
+
*/
|
|
18
|
+
export default abstract class Commands extends VehicleSpecific {
|
|
19
|
+
#private;
|
|
20
|
+
/** Delay between WAIT-retries; overridable so tests don't have to wait for real timers. */
|
|
21
|
+
protected retryDelayMs: number;
|
|
22
|
+
private readonly fromDestination;
|
|
23
|
+
private readonly sessions;
|
|
24
|
+
constructor(parent: Vehicle, vin: string, privateKey?: Buffer, publicKey?: Buffer);
|
|
25
|
+
/**
|
|
26
|
+
* Transmit a signed (or session-handshake) `RoutableMessage` to the
|
|
27
|
+
* vehicle and return its reply. Implementations must call
|
|
28
|
+
* `validateAndUpdateSession(resp, msg.uuid)` on the reply before
|
|
29
|
+
* returning it.
|
|
30
|
+
*/
|
|
31
|
+
protected abstract _send(msg: RoutableMessage, requires: string, expectsData?: boolean, confirmBroadcast?: (status: VehicleStatus) => boolean): Promise<RoutableMessage>;
|
|
32
|
+
private sessionFor;
|
|
33
|
+
/**
|
|
34
|
+
* Absorb session info piggy-backed on any signed-command reply and raise
|
|
35
|
+
* on a whitelist rejection or a terminal message fault. Every concrete
|
|
36
|
+
* `_send` must call this on the reply - passing the `uuid` of the request
|
|
37
|
+
* it just sent - before returning it.
|
|
38
|
+
*
|
|
39
|
+
* A `SessionInfo` is untrusted wire data until its `session_info_tag` is
|
|
40
|
+
* verified: the tag is an HMAC over the exact bytes received, keyed by a
|
|
41
|
+
* key derived from the *candidate* vehicle public key carried inside that
|
|
42
|
+
* same SessionInfo, and bound to this request's `uuid` as a challenge (so
|
|
43
|
+
* a captured older reply can't be replayed against a newer request). Only
|
|
44
|
+
* once that tag checks out do we act on anything the message claims -
|
|
45
|
+
* including its own whitelist-status field - and even then `Session.commit`
|
|
46
|
+
* still refuses a clock time that regresses within the same epoch.
|
|
47
|
+
*/
|
|
48
|
+
protected validateAndUpdateSession(resp: RoutableMessage, requestUuid: Buffer): void;
|
|
49
|
+
private handshake;
|
|
50
|
+
private buildHmacMessage;
|
|
51
|
+
/**
|
|
52
|
+
* Build, sign, dispatch (with WAIT/epoch-fault retry), and interpret one
|
|
53
|
+
* domain command.
|
|
54
|
+
*
|
|
55
|
+
* VCSEC requires messages to arrive in strict counter order and warns
|
|
56
|
+
* clients to avoid simultaneous requests to it at all (unlike
|
|
57
|
+
* Infotainment, which tolerates a sliding window) - so for
|
|
58
|
+
* `DOMAIN_VEHICLE_SECURITY` the *entire* dispatch (handshake, build,
|
|
59
|
+
* send, and any retry) runs under the domain's lock, guaranteeing at
|
|
60
|
+
* most one VCSEC message is ever in flight. Infotainment keeps the
|
|
61
|
+
* narrower build-only lock, serializing only counter assignment.
|
|
62
|
+
*/
|
|
63
|
+
private dispatch;
|
|
64
|
+
private interpretResponse;
|
|
65
|
+
private interpretVcsecResponse;
|
|
66
|
+
private interpretInfotainmentResponse;
|
|
67
|
+
private sendVehicleSecurity;
|
|
68
|
+
private sendInfotainment;
|
|
69
|
+
private vehicleAction;
|
|
70
|
+
private resolveSeat;
|
|
71
|
+
/**
|
|
72
|
+
* Controls the front (which_trunk: "front") or rear (which_trunk: "rear") trunk.
|
|
73
|
+
* @param which_trunk "front" or "rear"
|
|
74
|
+
*/
|
|
75
|
+
actuate_truck(which_trunk: Trunk): Promise<CommandResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* Adjusts vehicle media playback volume.
|
|
78
|
+
* @param volume A floating point number from 0.0 to 11.0.
|
|
79
|
+
*/
|
|
80
|
+
adjust_volume(volume: number): Promise<CommandResponse>;
|
|
81
|
+
/** Starts climate preconditioning. */
|
|
82
|
+
auto_conditioning_start(): Promise<CommandResponse>;
|
|
83
|
+
/** Stops climate preconditioning. */
|
|
84
|
+
auto_conditioning_stop(): Promise<CommandResponse>;
|
|
85
|
+
/** Cancels the countdown to install the vehicle software update. */
|
|
86
|
+
cancel_software_update(): Promise<CommandResponse>;
|
|
87
|
+
/** Charges in max range mode -- we recommend limiting the use of this mode to long trips. */
|
|
88
|
+
charge_max_range(): Promise<CommandResponse>;
|
|
89
|
+
/** Closes the charge port door. */
|
|
90
|
+
charge_port_door_close(): Promise<CommandResponse>;
|
|
91
|
+
/** Opens the charge port door. */
|
|
92
|
+
charge_port_door_open(): Promise<CommandResponse>;
|
|
93
|
+
/** Charges in Standard mode. */
|
|
94
|
+
charge_standard(): Promise<CommandResponse>;
|
|
95
|
+
/** Starts charging the vehicle. */
|
|
96
|
+
charge_start(): Promise<CommandResponse>;
|
|
97
|
+
/** Stops charging the vehicle. */
|
|
98
|
+
charge_stop(): Promise<CommandResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* 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.
|
|
101
|
+
*/
|
|
102
|
+
clear_pin_to_drive_admin(): Promise<CommandResponse>;
|
|
103
|
+
/** Locks the vehicle. */
|
|
104
|
+
door_lock(): Promise<CommandResponse>;
|
|
105
|
+
/** Unlocks the vehicle. */
|
|
106
|
+
door_unlock(): Promise<CommandResponse>;
|
|
107
|
+
/** Erases user's data from the user interface. Requires the vehicle to be in park. */
|
|
108
|
+
erase_user_data(): Promise<CommandResponse>;
|
|
109
|
+
/** Briefly flashes the vehicle headlights. Requires the vehicle to be in park. */
|
|
110
|
+
flash_lights(): Promise<CommandResponse>;
|
|
111
|
+
/**
|
|
112
|
+
* Restricts certain vehicle UI functionality from guest users
|
|
113
|
+
* @param enable `true` or `false`
|
|
114
|
+
*/
|
|
115
|
+
guest_mode(enable: boolean): Promise<CommandResponse>;
|
|
116
|
+
/** Honks the vehicle horn. Requires the vehicle to be in park. */
|
|
117
|
+
honk_horn(): Promise<CommandResponse>;
|
|
118
|
+
/** Advances media player to next favorite track. */
|
|
119
|
+
media_next_fav(): Promise<CommandResponse>;
|
|
120
|
+
/** Advances media player to next track. */
|
|
121
|
+
media_next_track(): Promise<CommandResponse>;
|
|
122
|
+
/** Advances media player to previous favorite track. */
|
|
123
|
+
media_prev_fav(): Promise<CommandResponse>;
|
|
124
|
+
/** Advances media player to previous track. */
|
|
125
|
+
media_prev_track(): Promise<CommandResponse>;
|
|
126
|
+
/** Toggles current play/pause state. */
|
|
127
|
+
media_toggle_playback(): Promise<CommandResponse>;
|
|
128
|
+
/** Turns the volume down by one. */
|
|
129
|
+
media_volume_down(): Promise<CommandResponse>;
|
|
130
|
+
/**
|
|
131
|
+
* Start navigation to given coordinates.
|
|
132
|
+
* @param lat Latitude
|
|
133
|
+
* @param lon Longitude
|
|
134
|
+
* @param order Trip order: `0` replaces the current trip (default), `1` prepends it as the next stop, `2` appends it as the last stop
|
|
135
|
+
*/
|
|
136
|
+
navigation_gps_request(lat: number, lon: number, order?: number): Promise<CommandResponse>;
|
|
137
|
+
/**
|
|
138
|
+
* Sends a location to the in-vehicle navigation system.
|
|
139
|
+
*
|
|
140
|
+
* `locale` and `type` are REST-only fields with no equivalent in the
|
|
141
|
+
* signed-command protocol (which only carries a destination string and a
|
|
142
|
+
* multi-stop order), so they are accepted for cross-transport signature
|
|
143
|
+
* parity but not sent.
|
|
144
|
+
* @param value Destination text
|
|
145
|
+
*/
|
|
146
|
+
navigation_request(value: string, _locale?: string, _type?: string): Promise<CommandResponse>;
|
|
147
|
+
/**
|
|
148
|
+
* Start navigation to a supercharger.
|
|
149
|
+
* @param id Supercharger ID
|
|
150
|
+
* @param order Trip order: `0` replaces the current trip (default), `1` prepends it as the next stop, `2` appends it as the last stop
|
|
151
|
+
*/
|
|
152
|
+
navigation_sc_request(id: number, order?: number): Promise<CommandResponse>;
|
|
153
|
+
/**
|
|
154
|
+
* Sets automatic seat heating and cooling. Only the front seats support this action.
|
|
155
|
+
* @param auto_seat_position `AutoSeat` position (1-indexed: front left is 1, front right is 2)
|
|
156
|
+
* @param auto_climate_on `true` or `false`
|
|
157
|
+
*/
|
|
158
|
+
remote_auto_seat_climate_request(auto_seat_position: keyof typeof AutoSeat | number, auto_climate_on: boolean): Promise<CommandResponse>;
|
|
159
|
+
/**
|
|
160
|
+
* Sets automatic steering wheel heating on/off.
|
|
161
|
+
* @param on `true` or `false`
|
|
162
|
+
*/
|
|
163
|
+
remote_auto_steering_wheel_heat_climate_request(on: boolean): Promise<CommandResponse>;
|
|
164
|
+
/**
|
|
165
|
+
* Plays a sound through the vehicle external speaker.
|
|
166
|
+
* @param sound Fart is `0`, Locate ping is `2000`
|
|
167
|
+
*/
|
|
168
|
+
remote_boombox(sound?: number): Promise<CommandResponse>;
|
|
169
|
+
/**
|
|
170
|
+
* Sets seat cooling. Only the front seats support this action.
|
|
171
|
+
* @param seat_position Seat position
|
|
172
|
+
* @param seat_cooler_level Cooling level
|
|
173
|
+
*/
|
|
174
|
+
remote_seat_cooler_request(seat_position: Seat | number, seat_cooler_level: Level): Promise<CommandResponse>;
|
|
175
|
+
/**
|
|
176
|
+
* Sets seat heating.
|
|
177
|
+
* @param seat_position Seat position
|
|
178
|
+
* @param seat_heater_level Heating level
|
|
179
|
+
*/
|
|
180
|
+
remote_seat_heater_request(seat_position: Seat | number, seat_heater_level: Level): Promise<CommandResponse>;
|
|
181
|
+
/** Starts the vehicle remotely. Requires keyless driving to be enabled. */
|
|
182
|
+
remote_start_drive(): Promise<CommandResponse>;
|
|
183
|
+
/**
|
|
184
|
+
* Sets steering wheel heat level.
|
|
185
|
+
* @param level Heating level (0=Off, 1=Low, 2=High)
|
|
186
|
+
*/
|
|
187
|
+
remote_steering_wheel_heat_level_request(level: Level): Promise<CommandResponse>;
|
|
188
|
+
/**
|
|
189
|
+
* Sets steering wheel heating on/off. For vehicles that do not support auto steering wheel heat.
|
|
190
|
+
* @param on `true` or `false`
|
|
191
|
+
*/
|
|
192
|
+
remote_steering_wheel_heater_request(on: boolean): Promise<CommandResponse>;
|
|
193
|
+
/** Removes PIN to Drive. Requires the car to be in Pin to Drive mode and not in Valet mode. */
|
|
194
|
+
reset_pin_to_drive_pin(): Promise<CommandResponse>;
|
|
195
|
+
/** Removes PIN for Valet Mode. */
|
|
196
|
+
reset_valet_pin(): Promise<CommandResponse>;
|
|
197
|
+
/**
|
|
198
|
+
* Schedules a vehicle software update (over the air "OTA") to be installed in the future.
|
|
199
|
+
* @param offset_sec Offset in seconds
|
|
200
|
+
*/
|
|
201
|
+
schedule_software_update(offset_sec: number): Promise<CommandResponse>;
|
|
202
|
+
/**
|
|
203
|
+
* Turns Bioweapon Defense Mode on and off.
|
|
204
|
+
* @param on `true` or `false`
|
|
205
|
+
* @param manual_override `true` or `false`
|
|
206
|
+
*/
|
|
207
|
+
set_bioweapon_mode(on: boolean, manual_override: boolean): Promise<CommandResponse>;
|
|
208
|
+
/**
|
|
209
|
+
* Sets the vehicle overheat protection.
|
|
210
|
+
* @param on `true` or `false`
|
|
211
|
+
* @param fan_only `true` or `false`
|
|
212
|
+
*/
|
|
213
|
+
set_cabin_overheat_protection(on: boolean, fan_only: boolean): Promise<CommandResponse>;
|
|
214
|
+
/**
|
|
215
|
+
* Sets the vehicle's charge limit to a custom percentage.
|
|
216
|
+
* @param percent Charge limit percentage typically between 50-100
|
|
217
|
+
*/
|
|
218
|
+
set_charge_limit(percent: number): Promise<CommandResponse>;
|
|
219
|
+
/**
|
|
220
|
+
* Sets the charging amps.
|
|
221
|
+
* @param charging_amps Current limit in Amps typically between 5-32
|
|
222
|
+
*/
|
|
223
|
+
set_charging_amps(charging_amps: number): Promise<CommandResponse>;
|
|
224
|
+
/**
|
|
225
|
+
* Enables climate keeper mode.
|
|
226
|
+
* @param climate_keeper_mode `0` is Off, `1` is Keep, `2` is Dog, `3` is Camp
|
|
227
|
+
*/
|
|
228
|
+
set_climate_keeper_mode(climate_keeper_mode: number | ClimateMode): Promise<CommandResponse>;
|
|
229
|
+
/**
|
|
230
|
+
* Adjusts the Cabin Overheat Protection temperature (COP).
|
|
231
|
+
* @param cop_temp Integer representing Low (0/30C/90F), Medium (1/35C/95F), or High (2/40C/100F)
|
|
232
|
+
*/
|
|
233
|
+
set_cop_temp(cop_temp: 0 | 1 | 2 | 30 | 35 | 40 | 90 | 95 | 100): Promise<CommandResponse>;
|
|
234
|
+
/**
|
|
235
|
+
* Sets a four-digit passcode for PIN to Drive.
|
|
236
|
+
* @param on `true` or `false`
|
|
237
|
+
* @param password Four-digit passcode
|
|
238
|
+
*/
|
|
239
|
+
set_pin_to_drive(on: boolean, password: string | number): Promise<CommandResponse>;
|
|
240
|
+
/**
|
|
241
|
+
* Sets an override for preconditioning — it should default to empty if no override is used.
|
|
242
|
+
* @param on `true` or `false`
|
|
243
|
+
* @param manual_override `true` or `false`
|
|
244
|
+
*/
|
|
245
|
+
set_preconditioning_max(on: boolean, manual_override: boolean): Promise<CommandResponse>;
|
|
246
|
+
/**
|
|
247
|
+
* Sets a time at which charging should be completed.
|
|
248
|
+
* @param enable `true` or `false`
|
|
249
|
+
* @param time Minutes after midnight
|
|
250
|
+
*/
|
|
251
|
+
set_scheduled_charging(enable: boolean, time: number): Promise<CommandResponse>;
|
|
252
|
+
/**
|
|
253
|
+
* Sets a time at which departure should be completed.
|
|
254
|
+
*
|
|
255
|
+
* `preconditioning_enabled` and `off_peak_charging_enabled` are accepted
|
|
256
|
+
* for cross-transport signature parity but have no field in the signed
|
|
257
|
+
* command protobuf, so they are not sent.
|
|
258
|
+
* @param enable `true` or `false`
|
|
259
|
+
* @param preconditioning_enabled not representable in a signed command
|
|
260
|
+
* @param preconditioning_weekdays_only `true` or `false`
|
|
261
|
+
* @param departure_time Minutes after midnight
|
|
262
|
+
* @param off_peak_charging_enabled not representable in a signed command
|
|
263
|
+
* @param off_peak_charging_weekdays_only `true` or `false`
|
|
264
|
+
* @param end_off_peak_time Minutes after midnight
|
|
265
|
+
*/
|
|
266
|
+
set_scheduled_departure(enable?: boolean, _preconditioning_enabled?: boolean, preconditioning_weekdays_only?: boolean, departure_time?: number, _off_peak_charging_enabled?: boolean, off_peak_charging_weekdays_only?: boolean, end_off_peak_time?: number): Promise<CommandResponse>;
|
|
267
|
+
/**
|
|
268
|
+
* Enables and disables Sentry Mode.
|
|
269
|
+
* @param on `true` or `false`
|
|
270
|
+
*/
|
|
271
|
+
set_sentry_mode(on: boolean): Promise<CommandResponse>;
|
|
272
|
+
/**
|
|
273
|
+
* Sets the driver and/or passenger-side cabin temperature (and other zones if sync is enabled).
|
|
274
|
+
* @param driver_temp Driver temperature
|
|
275
|
+
* @param passenger_temp Passenger temperature
|
|
276
|
+
*/
|
|
277
|
+
set_temps(driver_temp: number, passenger_temp: number): Promise<CommandResponse>;
|
|
278
|
+
/**
|
|
279
|
+
* Turns on Valet Mode and sets a four-digit passcode.
|
|
280
|
+
* @param on `true` or `false`
|
|
281
|
+
* @param password Four-digit passcode
|
|
282
|
+
*/
|
|
283
|
+
set_valet_mode(on: boolean, password: string | number): Promise<CommandResponse>;
|
|
284
|
+
/**
|
|
285
|
+
* Changes the name of a vehicle.
|
|
286
|
+
* @param vehicle_name New name
|
|
287
|
+
*/
|
|
288
|
+
set_vehicle_name(vehicle_name: string): Promise<CommandResponse>;
|
|
289
|
+
/**
|
|
290
|
+
* Activates Speed Limit Mode with a four-digit PIN.
|
|
291
|
+
* @param pin Four-digit PIN
|
|
292
|
+
*/
|
|
293
|
+
speed_limit_activate(pin: string | number): Promise<CommandResponse>;
|
|
294
|
+
/**
|
|
295
|
+
* Deactivates Speed Limit Mode and resets the associated PIN.
|
|
296
|
+
* @param pin Four-digit PIN
|
|
297
|
+
*/
|
|
298
|
+
speed_limit_clear_pin(pin: string | number): Promise<CommandResponse>;
|
|
299
|
+
/** Deactivates Speed Limit Mode and resets the associated PIN, for fleet managers or owners. */
|
|
300
|
+
speed_limit_clear_pin_admin(): Promise<CommandResponse>;
|
|
301
|
+
/**
|
|
302
|
+
* Deactivates Speed Limit Mode.
|
|
303
|
+
* @param pin Four-digit PIN
|
|
304
|
+
*/
|
|
305
|
+
speed_limit_deactivate(pin: string | number): Promise<CommandResponse>;
|
|
306
|
+
/**
|
|
307
|
+
* Sets the maximum speed allowed when Speed Limit Mode is active.
|
|
308
|
+
* @param limit_mph Maximum speed in MPH
|
|
309
|
+
*/
|
|
310
|
+
speed_limit_set_limit(limit_mph: number): Promise<CommandResponse>;
|
|
311
|
+
/**
|
|
312
|
+
* Controls the panoramic sunroof on the Model S.
|
|
313
|
+
*
|
|
314
|
+
* "stop" has no corresponding field in the signed-command protobuf (only
|
|
315
|
+
* vent/close/open), so it is rejected rather than guessed at.
|
|
316
|
+
* @param state "close" or "vent"
|
|
317
|
+
*/
|
|
318
|
+
sun_roof_control(state: "stop" | "close" | "vent"): Promise<CommandResponse>;
|
|
319
|
+
/**
|
|
320
|
+
* Records a drive note. Overrides the inherited plaintext command so it is
|
|
321
|
+
* signed and dispatched over the vehicle-command protocol rather than
|
|
322
|
+
* silently falling through to the unsigned REST endpoint on vehicles that
|
|
323
|
+
* require signing.
|
|
324
|
+
* @param note Drive note
|
|
325
|
+
*/
|
|
326
|
+
take_drivenote(note: string): Promise<CommandResponse>;
|
|
327
|
+
/**
|
|
328
|
+
* Turns on HomeLink (used to open and close garage doors).
|
|
329
|
+
* @param lat Latitude
|
|
330
|
+
* @param lon Longitude
|
|
331
|
+
* @param token
|
|
332
|
+
*/
|
|
333
|
+
trigger_homelink(lat: number, lon: number, token?: string): Promise<CommandResponse>;
|
|
334
|
+
/**
|
|
335
|
+
* Sends upcoming calendar entries to the vehicle. Overrides the inherited
|
|
336
|
+
* plaintext command so it is signed and dispatched over the vehicle-command
|
|
337
|
+
* protocol rather than silently falling through to the unsigned REST
|
|
338
|
+
* endpoint on vehicles that require signing.
|
|
339
|
+
* @param calendar_data Calendar data
|
|
340
|
+
*/
|
|
341
|
+
upcoming_calendar_entries(calendar_data: string): Promise<CommandResponse>;
|
|
342
|
+
/**
|
|
343
|
+
* Control the windows of a parked vehicle. Supported commands: vent and close.
|
|
344
|
+
* @param command "vent" or "close"
|
|
345
|
+
* @param lat Latitude
|
|
346
|
+
* @param lon Longitude
|
|
347
|
+
*/
|
|
348
|
+
window_control(command: "vent" | "close", _lat?: number, _lon?: number): Promise<CommandResponse>;
|
|
349
|
+
}
|