tesla-fleet-api 0.3.0 → 0.5.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/README.md +284 -1
- package/dist/_virtual/_rolldown/runtime.cjs +32 -0
- package/dist/_virtual/_rolldown/runtime.mjs +12 -0
- package/dist/bluetooth/adapters/shared.cjs +38 -0
- package/dist/bluetooth/adapters/shared.mjs +36 -0
- package/dist/bluetooth/async.cjs +121 -0
- package/dist/bluetooth/async.d.cts +10 -0
- package/dist/bluetooth/async.d.mts +10 -0
- package/dist/bluetooth/async.mjs +116 -0
- package/dist/bluetooth/broadcast.cjs +153 -0
- package/dist/bluetooth/broadcast.d.cts +59 -0
- package/dist/bluetooth/broadcast.d.mts +59 -0
- package/dist/bluetooth/broadcast.mjs +151 -0
- package/dist/bluetooth/constants.cjs +99 -0
- package/dist/bluetooth/constants.d.cts +70 -0
- package/dist/bluetooth/constants.d.mts +70 -0
- package/dist/bluetooth/constants.mjs +72 -0
- package/dist/bluetooth/esphome.cjs +292 -0
- package/dist/bluetooth/esphome.d.cts +83 -0
- package/dist/bluetooth/esphome.d.mts +83 -0
- package/dist/bluetooth/esphome.mjs +291 -0
- package/dist/bluetooth/framing.cjs +125 -0
- package/dist/bluetooth/framing.d.cts +45 -0
- package/dist/bluetooth/framing.d.mts +45 -0
- package/dist/bluetooth/framing.mjs +122 -0
- package/dist/bluetooth/homey.cjs +155 -0
- package/dist/bluetooth/homey.d.cts +75 -0
- package/dist/bluetooth/homey.d.mts +75 -0
- package/dist/bluetooth/homey.mjs +150 -0
- package/dist/bluetooth/names.cjs +24 -0
- package/dist/bluetooth/names.d.cts +10 -0
- package/dist/bluetooth/names.d.mts +10 -0
- package/dist/bluetooth/names.mjs +20 -0
- package/dist/bluetooth/noble.cjs +178 -0
- package/dist/bluetooth/noble.d.cts +58 -0
- package/dist/bluetooth/noble.d.mts +58 -0
- package/dist/bluetooth/noble.mjs +177 -0
- package/dist/bluetooth/streamglue.cjs +157 -0
- package/dist/bluetooth/streamglue.d.cts +37 -0
- package/dist/bluetooth/streamglue.d.mts +37 -0
- package/dist/bluetooth/streamglue.mjs +154 -0
- package/dist/bluetooth/teslabluetooth.cjs +67 -0
- package/dist/bluetooth/teslabluetooth.d.cts +41 -0
- package/dist/bluetooth/teslabluetooth.d.mts +41 -0
- package/dist/bluetooth/teslabluetooth.mjs +66 -0
- package/dist/bluetooth/transport.cjs +10 -0
- package/dist/bluetooth/transport.d.cts +95 -0
- package/dist/bluetooth/transport.d.mts +95 -0
- package/dist/bluetooth/transport.mjs +10 -0
- package/dist/bluetooth/vehiclebluetooth.cjs +1272 -0
- package/dist/bluetooth/vehiclebluetooth.d.cts +495 -0
- package/dist/bluetooth/vehiclebluetooth.d.mts +495 -0
- package/dist/bluetooth/vehiclebluetooth.mjs +1270 -0
- package/dist/bluetooth/verify.cjs +93 -0
- package/dist/bluetooth/verify.d.cts +35 -0
- package/dist/bluetooth/verify.d.mts +35 -0
- package/dist/bluetooth/verify.mjs +91 -0
- package/dist/bluetooth.cjs +53 -0
- package/dist/bluetooth.d.cts +10 -0
- package/dist/bluetooth.d.mts +10 -0
- package/dist/bluetooth.mjs +9 -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 +1797 -0
- package/dist/commands.d.cts +881 -0
- package/dist/commands.d.mts +881 -0
- package/dist/commands.mjs +1791 -0
- package/dist/const.cjs +322 -0
- package/dist/const.d.cts +308 -0
- package/dist/const.d.mts +308 -0
- package/dist/const.mjs +282 -0
- package/dist/energy.cjs +142 -0
- package/dist/energy.d.cts +101 -0
- package/dist/energy.d.mts +100 -0
- package/dist/energy.mjs +142 -0
- package/dist/energyisland.cjs +38 -0
- package/dist/energyisland.mjs +37 -0
- package/dist/energyparsers.cjs +118 -0
- package/dist/energyparsers.d.cts +39 -0
- package/dist/energyparsers.d.mts +39 -0
- package/dist/energyparsers.mjs +116 -0
- package/dist/energyspecific.cjs +457 -0
- package/dist/energyspecific.d.cts +258 -0
- package/dist/energyspecific.d.mts +258 -0
- package/dist/energyspecific.mjs +451 -0
- package/dist/exceptions.cjs +1488 -0
- package/dist/exceptions.d.cts +1143 -0
- package/dist/exceptions.d.mts +1143 -0
- package/dist/exceptions.mjs +1325 -0
- package/dist/funnel.cjs +297 -0
- package/dist/funnel.d.cts +118 -0
- package/dist/funnel.d.mts +118 -0
- package/dist/funnel.mjs +292 -0
- package/dist/index.cjs +287 -0
- package/dist/index.d.cts +28 -0
- package/dist/index.d.mts +28 -0
- package/dist/index.mjs +27 -0
- package/dist/log.cjs +75 -0
- package/dist/log.d.cts +4 -0
- package/dist/log.d.mts +4 -0
- package/dist/log.mjs +71 -0
- package/dist/oauth.cjs +143 -0
- package/dist/oauth.d.cts +69 -0
- package/dist/oauth.d.mts +69 -0
- package/dist/oauth.mjs +143 -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/powerwall/client.cjs +818 -0
- package/dist/powerwall/client.d.cts +297 -0
- package/dist/powerwall/client.d.mts +297 -0
- package/dist/powerwall/client.mjs +807 -0
- package/dist/powerwall/components.cjs +188 -0
- package/dist/powerwall/components.d.cts +45 -0
- package/dist/powerwall/components.d.mts +45 -0
- package/dist/powerwall/components.mjs +182 -0
- package/dist/powerwall/energysite.cjs +216 -0
- package/dist/powerwall/energysite.d.cts +104 -0
- package/dist/powerwall/energysite.d.mts +104 -0
- package/dist/powerwall/energysite.mjs +214 -0
- package/dist/powerwall/exceptions.cjs +59 -0
- package/dist/powerwall/exceptions.d.cts +38 -0
- package/dist/powerwall/exceptions.d.mts +38 -0
- package/dist/powerwall/exceptions.mjs +51 -0
- package/dist/powerwall/gateway.cjs +102 -0
- package/dist/powerwall/gateway.d.cts +57 -0
- package/dist/powerwall/gateway.d.mts +57 -0
- package/dist/powerwall/gateway.mjs +101 -0
- package/dist/powerwall/merge.cjs +163 -0
- package/dist/powerwall/merge.d.cts +63 -0
- package/dist/powerwall/merge.d.mts +63 -0
- package/dist/powerwall/merge.mjs +159 -0
- package/dist/powerwall/models.d.cts +95 -0
- package/dist/powerwall/models.d.mts +95 -0
- package/dist/powerwall/queries.cjs +17 -0
- package/dist/powerwall/queries.mjs +10 -0
- package/dist/powerwall/transport.cjs +232 -0
- package/dist/powerwall/transport.mjs +227 -0
- package/dist/powerwall.cjs +47 -0
- package/dist/powerwall.d.cts +9 -0
- package/dist/powerwall.d.mts +9 -0
- package/dist/powerwall.mjs +8 -0
- package/dist/router/base.cjs +203 -0
- package/dist/router/base.d.cts +112 -0
- package/dist/router/base.d.mts +112 -0
- package/dist/router/base.mjs +200 -0
- package/dist/router/energysite.cjs +65 -0
- package/dist/router/energysite.d.cts +47 -0
- package/dist/router/energysite.d.mts +47 -0
- package/dist/router/energysite.mjs +60 -0
- package/dist/router.cjs +13 -0
- package/dist/router.d.cts +3 -0
- package/dist/router.d.mts +3 -0
- package/dist/router.mjs +3 -0
- package/dist/signing/crypto.cjs +59 -0
- package/dist/signing/crypto.mjs +52 -0
- package/dist/signing/energy.cjs +123 -0
- package/dist/signing/energy.d.cts +45 -0
- package/dist/signing/energy.d.mts +45 -0
- package/dist/signing/energy.mjs +120 -0
- package/dist/signing/jws.cjs +229 -0
- package/dist/signing/jws.d.cts +45 -0
- package/dist/signing/jws.d.mts +45 -0
- package/dist/signing/jws.mjs +211 -0
- package/dist/signing/keys.cjs +191 -0
- package/dist/signing/keys.d.cts +21 -0
- package/dist/signing/keys.d.mts +21 -0
- package/dist/signing/keys.mjs +182 -0
- package/dist/signing/session.cjs +186 -0
- package/dist/signing/session.d.cts +106 -0
- package/dist/signing/session.d.mts +106 -0
- package/dist/signing/session.mjs +184 -0
- package/dist/tariff.cjs +319 -0
- package/dist/tariff.d.cts +40 -0
- package/dist/tariff.d.mts +40 -0
- package/dist/tariff.mjs +317 -0
- package/dist/teslafleetapi.cjs +326 -0
- package/dist/teslafleetapi.d.cts +160 -0
- package/dist/teslafleetapi.d.mts +160 -0
- package/dist/teslafleetapi.mjs +326 -0
- package/dist/teslemetry.cjs +183 -0
- package/dist/teslemetry.d.cts +113 -0
- package/dist/teslemetry.d.mts +113 -0
- package/dist/teslemetry.mjs +181 -0
- package/dist/teslemetryenergy.cjs +287 -0
- package/dist/teslemetryenergy.d.cts +154 -0
- package/dist/teslemetryenergy.d.mts +154 -0
- package/dist/teslemetryenergy.mjs +282 -0
- package/dist/teslemetryvehicle.cjs +407 -0
- package/dist/teslemetryvehicle.d.cts +238 -0
- package/dist/teslemetryvehicle.d.mts +238 -0
- package/dist/teslemetryvehicle.mjs +405 -0
- package/dist/tessie.cjs +71 -0
- package/dist/tessie.d.cts +69 -0
- package/dist/tessie.d.mts +69 -0
- package/dist/tessie.mjs +71 -0
- package/dist/tessievehicle.cjs +514 -0
- package/dist/tessievehicle.d.cts +333 -0
- package/dist/tessievehicle.d.mts +333 -0
- package/dist/tessievehicle.mjs +513 -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 +13 -0
- package/dist/types/responses.d.mts +13 -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 +33 -0
- package/dist/types/vehicle.d.mts +33 -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/util.cjs +41 -0
- package/dist/util.d.cts +18 -0
- package/dist/util.d.mts +18 -0
- package/dist/util.mjs +40 -0
- package/dist/vehicle.cjs +847 -0
- package/dist/vehicle.d.cts +566 -0
- package/dist/vehicle.d.mts +565 -0
- package/dist/vehicle.mjs +847 -0
- package/dist/vehiclesigned.cjs +35 -0
- package/dist/vehiclesigned.d.cts +23 -0
- package/dist/vehiclesigned.d.mts +22 -0
- package/dist/vehiclesigned.mjs +35 -0
- package/dist/vehiclespecific.cjs +715 -0
- package/dist/vehiclespecific.d.cts +497 -0
- package/dist/vehiclespecific.d.mts +496 -0
- package/dist/vehiclespecific.mjs +715 -0
- package/package.json +178 -38
- 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 -15
- package/dist/index.js +0 -15
- 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.d.ts +0 -29
- 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 -23
- package/dist/types/vehicle.js +0 -10
- 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 -774
- package/dist/vehicle.js.map +0 -1
- package/dist/vehiclesigned.d.ts +0 -13
- 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/energy.ts +0 -217
- package/src/energyspecific.ts +0 -116
- package/src/helpers.ts +0 -11
- package/src/index.ts +0 -21
- 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 -33
- package/src/types/vehicle_data.ts +0 -286
- package/src/user.ts +0 -35
- package/src/vehicle.ts +0 -886
- package/src/vehiclesigned.ts +0 -20
- package/src/vehiclespecific.ts +0 -818
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import Vehicle from "./vehicle.mjs";
|
|
2
|
+
import VehicleSpecific from "./vehiclespecific.mjs";
|
|
3
|
+
// src/tessievehicle.ts
|
|
4
|
+
/** Query parameters with `start` and `end` renamed to Tessie's `from` and `to`. */
|
|
5
|
+
function fromTo({ start, end, ...params }) {
|
|
6
|
+
return {
|
|
7
|
+
from: start,
|
|
8
|
+
to: end,
|
|
9
|
+
...params
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/** Query parameters of a paged read: `fromTo`, with `results` standing in for an unset `limit`. */
|
|
13
|
+
function paged({ limit, results, ...params }) {
|
|
14
|
+
return {
|
|
15
|
+
...fromTo(params),
|
|
16
|
+
limit: limit ?? results
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A Tessie vehicle: Tessie's commands and reads, on top of the Fleet REST commands.
|
|
21
|
+
*
|
|
22
|
+
* Commands take `wait_for_completion` and `max_attempts` last, falling back to
|
|
23
|
+
* the client's. As in Python, the `tessie_*` methods take the two in the
|
|
24
|
+
* opposite order to the rest.
|
|
25
|
+
*/
|
|
26
|
+
var TessieVehicle = class extends VehicleSpecific {
|
|
27
|
+
_request(method, path, params, json) {
|
|
28
|
+
return this.parent.parent._request(method, path, params, json);
|
|
29
|
+
}
|
|
30
|
+
/** The query string of a command, with the client's defaults for anything not given. */
|
|
31
|
+
_command_params(wait_for_completion, max_attempts, params = {}) {
|
|
32
|
+
return {
|
|
33
|
+
wait_for_completion: wait_for_completion ?? this.parent.parent.wait_for_completion,
|
|
34
|
+
...params,
|
|
35
|
+
max_attempts: max_attempts ?? this.parent.parent.max_attempts
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
_command(name, wait_for_completion, max_attempts, params) {
|
|
39
|
+
return this._request("POST", `${this.vin}/command/${name}`, this._command_params(wait_for_completion, max_attempts, params));
|
|
40
|
+
}
|
|
41
|
+
/** Wake the vehicle from sleep. `_wait_for_completion` is accepted and ignored, as in Python. */
|
|
42
|
+
async wake(_wait_for_completion) {
|
|
43
|
+
return this._request("POST", `${this.vin}/wake`);
|
|
44
|
+
}
|
|
45
|
+
/** Lock the doors. */
|
|
46
|
+
async lock(wait_for_completion, max_attempts) {
|
|
47
|
+
return this._command("lock", wait_for_completion, max_attempts);
|
|
48
|
+
}
|
|
49
|
+
/** Unlock the doors. */
|
|
50
|
+
async unlock(wait_for_completion, max_attempts) {
|
|
51
|
+
return this._command("unlock", wait_for_completion, max_attempts);
|
|
52
|
+
}
|
|
53
|
+
/** Open the front trunk. */
|
|
54
|
+
async activate_front_trunk(wait_for_completion, max_attempts) {
|
|
55
|
+
return this._command("activate_front_trunk", wait_for_completion, max_attempts);
|
|
56
|
+
}
|
|
57
|
+
/** Open or close the rear trunk. */
|
|
58
|
+
async activate_rear_trunk(wait_for_completion, max_attempts) {
|
|
59
|
+
return this._command("activate_rear_trunk", wait_for_completion, max_attempts);
|
|
60
|
+
}
|
|
61
|
+
/** Open the truck tonneau cover. */
|
|
62
|
+
async open_tonneau(wait_for_completion, max_attempts) {
|
|
63
|
+
return this._command("open_tonneau", wait_for_completion, max_attempts);
|
|
64
|
+
}
|
|
65
|
+
/** Close the truck tonneau cover. */
|
|
66
|
+
async close_tonneau(wait_for_completion, max_attempts) {
|
|
67
|
+
return this._command("close_tonneau", wait_for_completion, max_attempts);
|
|
68
|
+
}
|
|
69
|
+
/** Open all windows. */
|
|
70
|
+
async vent_windows(wait_for_completion, max_attempts) {
|
|
71
|
+
return this._command("vent_windows", wait_for_completion, max_attempts);
|
|
72
|
+
}
|
|
73
|
+
/** Close all windows. */
|
|
74
|
+
async close_windows(wait_for_completion, max_attempts) {
|
|
75
|
+
return this._command("close_windows", wait_for_completion, max_attempts);
|
|
76
|
+
}
|
|
77
|
+
/** Start the climate system. */
|
|
78
|
+
async start_climate(wait_for_completion, max_attempts) {
|
|
79
|
+
return this._command("start_climate", wait_for_completion, max_attempts);
|
|
80
|
+
}
|
|
81
|
+
/** Stop the climate system. */
|
|
82
|
+
async stop_climate(wait_for_completion, max_attempts) {
|
|
83
|
+
return this._command("stop_climate", wait_for_completion, max_attempts);
|
|
84
|
+
}
|
|
85
|
+
/** Set the cabin temperature. */
|
|
86
|
+
async set_temperatures(temperature, wait_for_completion, max_attempts) {
|
|
87
|
+
return this._command("set_temperatures", wait_for_completion, max_attempts, { temperature });
|
|
88
|
+
}
|
|
89
|
+
/** Adjust a seat's heating level. */
|
|
90
|
+
async set_seat_heat(seat, level, wait_for_completion, max_attempts) {
|
|
91
|
+
return this._command("set_seat_heat", wait_for_completion, max_attempts, {
|
|
92
|
+
seat,
|
|
93
|
+
level
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/** Adjust a seat's cooling level. */
|
|
97
|
+
async set_seat_cool(seat, level, wait_for_completion, max_attempts) {
|
|
98
|
+
return this._command("set_seat_cool", wait_for_completion, max_attempts, {
|
|
99
|
+
seat,
|
|
100
|
+
level
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/** Begin defrosting. */
|
|
104
|
+
async start_max_defrost(wait_for_completion, max_attempts) {
|
|
105
|
+
return this._command("start_max_defrost", wait_for_completion, max_attempts);
|
|
106
|
+
}
|
|
107
|
+
/** End defrosting. */
|
|
108
|
+
async stop_max_defrost(wait_for_completion, max_attempts) {
|
|
109
|
+
return this._command("stop_max_defrost", wait_for_completion, max_attempts);
|
|
110
|
+
}
|
|
111
|
+
/** Enable the heated steering wheel. */
|
|
112
|
+
async start_steering_wheel_heater(wait_for_completion, max_attempts) {
|
|
113
|
+
return this._command("start_steering_wheel_heater", wait_for_completion, max_attempts);
|
|
114
|
+
}
|
|
115
|
+
/** Disable the heated steering wheel. */
|
|
116
|
+
async stop_steering_wheel_heater(wait_for_completion, max_attempts) {
|
|
117
|
+
return this._command("stop_steering_wheel_heater", wait_for_completion, max_attempts);
|
|
118
|
+
}
|
|
119
|
+
/** Configure overheat protection. */
|
|
120
|
+
async tessie_set_cabin_overheat_protection(on, fan_only = false, max_attempts, wait_for_completion) {
|
|
121
|
+
return this._command("set_cabin_overheat_protection", wait_for_completion, max_attempts, {
|
|
122
|
+
on,
|
|
123
|
+
fan_only
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/** Set the overheat protection temperature. */
|
|
127
|
+
async tessie_set_cop_temp(cop_temp, max_attempts, wait_for_completion) {
|
|
128
|
+
return this._command("set_cop_temp", wait_for_completion, max_attempts, { cop_temp });
|
|
129
|
+
}
|
|
130
|
+
/** Enable or disable defense mode. */
|
|
131
|
+
async tessie_set_bioweapon_mode(on, max_attempts, wait_for_completion) {
|
|
132
|
+
return this._command("set_bioweapon_mode", wait_for_completion, max_attempts, { on });
|
|
133
|
+
}
|
|
134
|
+
/** Configure climate keeper. */
|
|
135
|
+
async tessie_set_climate_keeper_mode(mode, max_attempts, wait_for_completion) {
|
|
136
|
+
return this._command("set_climate_keeper_mode", wait_for_completion, max_attempts, { mode });
|
|
137
|
+
}
|
|
138
|
+
/** Begin a charging session. */
|
|
139
|
+
async start_charging(wait_for_completion, max_attempts) {
|
|
140
|
+
return this._command("start_charging", wait_for_completion, max_attempts);
|
|
141
|
+
}
|
|
142
|
+
/** End a charging session. */
|
|
143
|
+
async stop_charging(wait_for_completion, max_attempts) {
|
|
144
|
+
return this._command("stop_charging", wait_for_completion, max_attempts);
|
|
145
|
+
}
|
|
146
|
+
/** Set the target charge percentage. */
|
|
147
|
+
async set_charge_limit(percent, wait_for_completion, max_attempts) {
|
|
148
|
+
return this._command("set_charge_limit", wait_for_completion, max_attempts, { percent });
|
|
149
|
+
}
|
|
150
|
+
/** Adjust the charging amperage. */
|
|
151
|
+
async tessie_set_charging_amps(amps, max_attempts, wait_for_completion) {
|
|
152
|
+
return this._command("set_charging_amps", wait_for_completion, max_attempts, { amps });
|
|
153
|
+
}
|
|
154
|
+
/** Open or unlock the charge port. */
|
|
155
|
+
async open_charge_port(wait_for_completion, max_attempts) {
|
|
156
|
+
return this._command("open_charge_port", wait_for_completion, max_attempts);
|
|
157
|
+
}
|
|
158
|
+
/** Close the charge port. */
|
|
159
|
+
async close_charge_port(wait_for_completion, max_attempts) {
|
|
160
|
+
return this._command("close_charge_port", wait_for_completion, max_attempts);
|
|
161
|
+
}
|
|
162
|
+
/** Flash the lights. */
|
|
163
|
+
async flash(wait_for_completion, max_attempts) {
|
|
164
|
+
return this._command("flash", wait_for_completion, max_attempts);
|
|
165
|
+
}
|
|
166
|
+
/** Sound the horn. */
|
|
167
|
+
async honk(wait_for_completion, max_attempts) {
|
|
168
|
+
return this._command("honk", wait_for_completion, max_attempts);
|
|
169
|
+
}
|
|
170
|
+
/** Activate a HomeLink device. */
|
|
171
|
+
async tessie_trigger_homelink(max_attempts, wait_for_completion) {
|
|
172
|
+
return this._command("trigger_homelink", wait_for_completion, max_attempts);
|
|
173
|
+
}
|
|
174
|
+
/** Enable keyless driving. */
|
|
175
|
+
async remote_start(wait_for_completion, max_attempts) {
|
|
176
|
+
return this._command("remote_start", wait_for_completion, max_attempts);
|
|
177
|
+
}
|
|
178
|
+
/** Open the sunroof. */
|
|
179
|
+
async vent_sunroof(wait_for_completion, max_attempts) {
|
|
180
|
+
return this._command("vent_sunroof", wait_for_completion, max_attempts);
|
|
181
|
+
}
|
|
182
|
+
/** Close the sunroof. */
|
|
183
|
+
async close_sunroof(wait_for_completion, max_attempts) {
|
|
184
|
+
return this._command("close_sunroof", wait_for_completion, max_attempts);
|
|
185
|
+
}
|
|
186
|
+
/** Activate Sentry Mode. */
|
|
187
|
+
async enable_sentry(wait_for_completion, max_attempts) {
|
|
188
|
+
return this._command("enable_sentry", wait_for_completion, max_attempts);
|
|
189
|
+
}
|
|
190
|
+
/** Deactivate Sentry Mode. */
|
|
191
|
+
async disable_sentry(wait_for_completion, max_attempts) {
|
|
192
|
+
return this._command("disable_sentry", wait_for_completion, max_attempts);
|
|
193
|
+
}
|
|
194
|
+
/** Activate Valet Mode. */
|
|
195
|
+
async enable_valet(pin, wait_for_completion, max_attempts) {
|
|
196
|
+
return this._command("enable_valet", wait_for_completion, max_attempts, { pin: pin != null ? String(pin) : null });
|
|
197
|
+
}
|
|
198
|
+
/** Deactivate Valet Mode. */
|
|
199
|
+
async disable_valet(pin, wait_for_completion, max_attempts) {
|
|
200
|
+
return this._command("disable_valet", wait_for_completion, max_attempts, { pin: pin != null ? String(pin) : null });
|
|
201
|
+
}
|
|
202
|
+
/** Schedule an update installation. */
|
|
203
|
+
async tessie_schedule_software_update(in_seconds, max_attempts, wait_for_completion) {
|
|
204
|
+
return this._command("schedule_software_update", wait_for_completion, max_attempts, { in_seconds });
|
|
205
|
+
}
|
|
206
|
+
/** Cancel a pending update. */
|
|
207
|
+
async cancel_software_update(wait_for_completion, max_attempts) {
|
|
208
|
+
return this._command("cancel_software_update", wait_for_completion, max_attempts);
|
|
209
|
+
}
|
|
210
|
+
/** Configure scheduled charging. */
|
|
211
|
+
async set_scheduled_charging(enable, time, wait_for_completion, max_attempts) {
|
|
212
|
+
return this._command("set_scheduled_charging", wait_for_completion, max_attempts, {
|
|
213
|
+
enable,
|
|
214
|
+
time
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
/** Configure scheduled departure. */
|
|
218
|
+
async tessie_set_scheduled_departure(enable, departure_time, options = {}) {
|
|
219
|
+
return this._command("set_scheduled_departure", options.wait_for_completion, options.max_attempts, {
|
|
220
|
+
enable,
|
|
221
|
+
departure_time,
|
|
222
|
+
preconditioning_enabled: options.preconditioning_enabled ?? false,
|
|
223
|
+
preconditioning_weekdays_only: options.preconditioning_weekdays_only ?? false,
|
|
224
|
+
off_peak_charging_enabled: options.off_peak_charging_enabled ?? false,
|
|
225
|
+
off_peak_charging_weekdays_only: options.off_peak_charging_weekdays_only ?? false,
|
|
226
|
+
end_off_peak_time: options.end_off_peak_time
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Add a charging schedule.
|
|
231
|
+
* @throws Error when neither end is enabled, or an enabled end has no time.
|
|
232
|
+
*/
|
|
233
|
+
async tessie_add_charge_schedule(days_of_week, enabled, start_enabled, end_enabled, lat, lon, options = {}) {
|
|
234
|
+
const { start_time, end_time, one_time = false, id } = options;
|
|
235
|
+
if (!start_enabled && !end_enabled) throw new Error("Either start_enabled or end_enabled must be True");
|
|
236
|
+
if (start_enabled && start_time == null) throw new Error("start_time is required when start_enabled is True");
|
|
237
|
+
if (end_enabled && end_time == null) throw new Error("end_time is required when end_enabled is True");
|
|
238
|
+
return this._command("add_charge_schedule", options.wait_for_completion, options.max_attempts, {
|
|
239
|
+
days_of_week,
|
|
240
|
+
enabled,
|
|
241
|
+
start_enabled,
|
|
242
|
+
end_enabled,
|
|
243
|
+
lat,
|
|
244
|
+
lon,
|
|
245
|
+
one_time,
|
|
246
|
+
start_time,
|
|
247
|
+
end_time,
|
|
248
|
+
id
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
/** Delete a charging schedule. */
|
|
252
|
+
async remove_charge_schedule(id, wait_for_completion, max_attempts) {
|
|
253
|
+
return this._command("remove_charge_schedule", wait_for_completion, max_attempts, { id });
|
|
254
|
+
}
|
|
255
|
+
/** Add a preconditioning schedule. */
|
|
256
|
+
async tessie_add_precondition_schedule(days_of_week, enabled, lat, lon, precondition_time, options = {}) {
|
|
257
|
+
const { one_time = false, id } = options;
|
|
258
|
+
return this._command("add_precondition_schedule", options.wait_for_completion, options.max_attempts, {
|
|
259
|
+
days_of_week,
|
|
260
|
+
enabled,
|
|
261
|
+
lat,
|
|
262
|
+
lon,
|
|
263
|
+
precondition_time,
|
|
264
|
+
one_time,
|
|
265
|
+
id
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
/** Delete a preconditioning schedule. */
|
|
269
|
+
async remove_precondition_schedule(id, wait_for_completion, max_attempts) {
|
|
270
|
+
return this._command("remove_precondition_schedule", wait_for_completion, max_attempts, { id });
|
|
271
|
+
}
|
|
272
|
+
/** Share an address or location to the vehicle. */
|
|
273
|
+
async share(value, locale = "en-US", wait_for_completion, max_attempts) {
|
|
274
|
+
return this._command("share", wait_for_completion, max_attempts, {
|
|
275
|
+
value,
|
|
276
|
+
locale
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
/** Trigger a novelty sound effect. */
|
|
280
|
+
async remote_boombox(sound, wait_for_completion, max_attempts) {
|
|
281
|
+
return this._command("remote_boombox", wait_for_completion, max_attempts, { sound });
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Set the speed limit.
|
|
285
|
+
* @param limit_mph Used when `mph` is not given.
|
|
286
|
+
* @param wait_for_completion
|
|
287
|
+
* @param max_attempts
|
|
288
|
+
* @param mph
|
|
289
|
+
* @throws Error when neither `mph` nor `limit_mph` is given.
|
|
290
|
+
*/
|
|
291
|
+
async set_speed_limit(limit_mph, wait_for_completion, max_attempts, mph) {
|
|
292
|
+
const speed_limit = mph ?? limit_mph;
|
|
293
|
+
if (speed_limit == null) throw new Error("mph or limit_mph is required");
|
|
294
|
+
return this._command("set_speed_limit", wait_for_completion, max_attempts, { mph: speed_limit });
|
|
295
|
+
}
|
|
296
|
+
/** Activate the speed limit. */
|
|
297
|
+
async enable_speed_limit(pin, wait_for_completion, max_attempts) {
|
|
298
|
+
return this._command("enable_speed_limit", wait_for_completion, max_attempts, { pin: String(pin) });
|
|
299
|
+
}
|
|
300
|
+
/** Deactivate the speed limit. */
|
|
301
|
+
async disable_speed_limit(pin, wait_for_completion, max_attempts) {
|
|
302
|
+
return this._command("disable_speed_limit", wait_for_completion, max_attempts, { pin: String(pin) });
|
|
303
|
+
}
|
|
304
|
+
/** Remove the speed limit PIN. */
|
|
305
|
+
async clear_speed_limit_pin(pin, wait_for_completion, max_attempts) {
|
|
306
|
+
return this._command("clear_speed_limit_pin", wait_for_completion, max_attempts, { pin: String(pin) });
|
|
307
|
+
}
|
|
308
|
+
/** Activate guest mode. */
|
|
309
|
+
async enable_guest(wait_for_completion, max_attempts) {
|
|
310
|
+
return this._command("enable_guest", wait_for_completion, max_attempts);
|
|
311
|
+
}
|
|
312
|
+
/** Deactivate guest mode. */
|
|
313
|
+
async disable_guest(wait_for_completion, max_attempts) {
|
|
314
|
+
return this._command("disable_guest", wait_for_completion, max_attempts);
|
|
315
|
+
}
|
|
316
|
+
/** Enable Keep Accessory Power Mode. */
|
|
317
|
+
async enable_keep_accessory_power_mode(wait_for_completion, max_attempts) {
|
|
318
|
+
return this._command("enable_keep_accessory_power_mode", wait_for_completion, max_attempts);
|
|
319
|
+
}
|
|
320
|
+
/** Disable Keep Accessory Power Mode. */
|
|
321
|
+
async disable_keep_accessory_power_mode(wait_for_completion, max_attempts) {
|
|
322
|
+
return this._command("disable_keep_accessory_power_mode", wait_for_completion, max_attempts);
|
|
323
|
+
}
|
|
324
|
+
/** Enable Low Power Mode. */
|
|
325
|
+
async enable_low_power_mode(wait_for_completion, max_attempts) {
|
|
326
|
+
return this._command("enable_low_power_mode", wait_for_completion, max_attempts);
|
|
327
|
+
}
|
|
328
|
+
/** Disable Low Power Mode. */
|
|
329
|
+
async disable_low_power_mode(wait_for_completion, max_attempts) {
|
|
330
|
+
return this._command("disable_low_power_mode", wait_for_completion, max_attempts);
|
|
331
|
+
}
|
|
332
|
+
/** Get vehicle data. */
|
|
333
|
+
async state(use_cache = true) {
|
|
334
|
+
return this._request("GET", `${this.vin}/state`, { use_cache });
|
|
335
|
+
}
|
|
336
|
+
/** The same as `state`, under the Fleet name. */
|
|
337
|
+
async vehicle(use_cache = true) {
|
|
338
|
+
return this.state(use_cache);
|
|
339
|
+
}
|
|
340
|
+
/** Get battery data. */
|
|
341
|
+
async battery() {
|
|
342
|
+
return this._request("GET", `${this.vin}/battery`);
|
|
343
|
+
}
|
|
344
|
+
/** Get battery health data. */
|
|
345
|
+
async battery_health(start, end, distance_format) {
|
|
346
|
+
return this._request("GET", `${this.vin}/battery_health`, {
|
|
347
|
+
from: start,
|
|
348
|
+
to: end,
|
|
349
|
+
distance_format
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
/** Get historical vehicle states within a timeframe. */
|
|
353
|
+
async states(options = {}) {
|
|
354
|
+
return this._request("GET", `${this.vin}/states`, fromTo(options));
|
|
355
|
+
}
|
|
356
|
+
/** Get coordinates, address and saved location. */
|
|
357
|
+
async location() {
|
|
358
|
+
return this._request("GET", `${this.vin}/location`);
|
|
359
|
+
}
|
|
360
|
+
/** Get the list of firmware-generated alerts. */
|
|
361
|
+
async firmware_alerts() {
|
|
362
|
+
return this._request("GET", `${this.vin}/firmware_alerts`);
|
|
363
|
+
}
|
|
364
|
+
/** Get a map image of the vehicle's location. */
|
|
365
|
+
async map(options = {}) {
|
|
366
|
+
return this._request("GET", `${this.vin}/map`, options);
|
|
367
|
+
}
|
|
368
|
+
/** Get energy use since the last charge. */
|
|
369
|
+
async consumption_since_charge() {
|
|
370
|
+
return this._request("GET", `${this.vin}/consumption_since_charge`);
|
|
371
|
+
}
|
|
372
|
+
/** Get the weather forecast around the vehicle. */
|
|
373
|
+
async weather() {
|
|
374
|
+
return this._request("GET", `${this.vin}/weather`);
|
|
375
|
+
}
|
|
376
|
+
/** Get historical drive records. */
|
|
377
|
+
async drives(options = {}) {
|
|
378
|
+
return this._request("GET", `${this.vin}/drives`, paged(options));
|
|
379
|
+
}
|
|
380
|
+
/** Get the driving route during a timeframe. */
|
|
381
|
+
async path(start, end, options = {}) {
|
|
382
|
+
return this._request("GET", `${this.vin}/path`, {
|
|
383
|
+
from: start,
|
|
384
|
+
to: end,
|
|
385
|
+
...options
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
/** Get charging history. */
|
|
389
|
+
async charges(options = {}) {
|
|
390
|
+
return this._request("GET", `${this.vin}/charges`, paged(options));
|
|
391
|
+
}
|
|
392
|
+
/** Get the periods when the vehicle was idle. */
|
|
393
|
+
async idles(options = {}) {
|
|
394
|
+
return this._request("GET", `${this.vin}/idles`, paged(options));
|
|
395
|
+
}
|
|
396
|
+
/** Get the latest idle period. */
|
|
397
|
+
async last_idle_state() {
|
|
398
|
+
return this._request("GET", `${this.vin}/last_idle_state`);
|
|
399
|
+
}
|
|
400
|
+
/** List additional authorized drivers. */
|
|
401
|
+
async drivers() {
|
|
402
|
+
return this._request("GET", `${this.vin}/drivers`);
|
|
403
|
+
}
|
|
404
|
+
/** Remove a driver's access. */
|
|
405
|
+
async delete_driver(id, user_id) {
|
|
406
|
+
return this._request("POST", `${this.vin}/drivers/${id}/delete`, null, { user_id });
|
|
407
|
+
}
|
|
408
|
+
/** List pending driver invitations. */
|
|
409
|
+
async invitations() {
|
|
410
|
+
return this._request("GET", `${this.vin}/invitations`);
|
|
411
|
+
}
|
|
412
|
+
/** Create a driver invitation. */
|
|
413
|
+
async create_invitation(email, role) {
|
|
414
|
+
return this._request("POST", `${this.vin}/invitations`, {
|
|
415
|
+
email,
|
|
416
|
+
role
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
/** Cancel a driver invitation. */
|
|
420
|
+
async revoke_invitation(id) {
|
|
421
|
+
return this._request("POST", `${this.vin}/invitations/${id}/revoke`);
|
|
422
|
+
}
|
|
423
|
+
/** Assign the subscription or charging payer role. Requires a Tesla Business account. */
|
|
424
|
+
async set_roles(role, account_id, federation_id) {
|
|
425
|
+
return this._request("POST", `${this.vin}/roles`, null, {
|
|
426
|
+
role,
|
|
427
|
+
account_id,
|
|
428
|
+
federation_id
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
/** Get the telemetry configuration. */
|
|
432
|
+
async get_fleet_telemetry_config() {
|
|
433
|
+
return this._request("GET", `${this.vin}/fleet_telemetry_config`);
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Set the telemetry configuration.
|
|
437
|
+
* @param config The configuration.
|
|
438
|
+
* @param fields Replaces `config.fields`.
|
|
439
|
+
*/
|
|
440
|
+
async set_fleet_telemetry_config(config, fields) {
|
|
441
|
+
return this._request("POST", `${this.vin}/fleet_telemetry_config`, null, {
|
|
442
|
+
...config,
|
|
443
|
+
...fields != null ? { fields } : {}
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
/** Remove the telemetry configuration. */
|
|
447
|
+
async delete_fleet_telemetry_config() {
|
|
448
|
+
return this._request("DELETE", `${this.vin}/fleet_telemetry_config`);
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Assign a tag to drives, given by id or by timeframe.
|
|
452
|
+
* @throws Error without a `tag`, or without `drives` or both `start` and `end`.
|
|
453
|
+
*/
|
|
454
|
+
async set_drive_tag({ start, end, tag, drives }) {
|
|
455
|
+
if (tag == null) throw new Error("tag is required");
|
|
456
|
+
if (drives != null) return this._request("POST", `${this.vin}/drives/set_tag`, null, {
|
|
457
|
+
drives,
|
|
458
|
+
tag
|
|
459
|
+
});
|
|
460
|
+
if (start == null || end == null) throw new Error("Provide drives or both start and end");
|
|
461
|
+
return this._request("POST", `${this.vin}/drives/set_tag`, {
|
|
462
|
+
from: start,
|
|
463
|
+
to: end,
|
|
464
|
+
tag
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
/** Record a charge's cost. */
|
|
468
|
+
async set_charge_cost(charge_id, cost, currency) {
|
|
469
|
+
return this._request("POST", `${this.vin}/charges/${charge_id}/set_cost`, {
|
|
470
|
+
cost,
|
|
471
|
+
currency
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
/** Get the current tire pressure readings. */
|
|
475
|
+
async tire_pressure(pressure_format, start, end) {
|
|
476
|
+
return this._request("GET", `${this.vin}/tire_pressure`, {
|
|
477
|
+
pressure_format,
|
|
478
|
+
from: start,
|
|
479
|
+
to: end
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
/** Get the vehicle's operational status. */
|
|
483
|
+
async vehicle_status() {
|
|
484
|
+
return this._request("GET", `${this.vin}/status`);
|
|
485
|
+
}
|
|
486
|
+
/** Get license plate information. */
|
|
487
|
+
async plate() {
|
|
488
|
+
return this._request("GET", `${this.vin}/plate`);
|
|
489
|
+
}
|
|
490
|
+
/** Update license plate information. */
|
|
491
|
+
async update_plate(plate, state) {
|
|
492
|
+
return this._request("POST", `${this.vin}/plate`, null, {
|
|
493
|
+
plate,
|
|
494
|
+
state: state || void 0
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
/** Creates `TessieVehicle`s. Tessie cannot use the Fleet API directly, so `create` is the only factory. */
|
|
499
|
+
var TessieVehicles = class extends Vehicle {
|
|
500
|
+
/** Class `create` instantiates; a subclass overrides it to supply its own vehicle type. */
|
|
501
|
+
static Vehicle = TessieVehicle;
|
|
502
|
+
createFleet = void 0;
|
|
503
|
+
createSigned = void 0;
|
|
504
|
+
specific = void 0;
|
|
505
|
+
specificSigned = void 0;
|
|
506
|
+
/** Creates a vehicle, and records it by VIN. */
|
|
507
|
+
create(vin) {
|
|
508
|
+
const vehicle = new this.constructor.Vehicle(this, vin);
|
|
509
|
+
this.byVin.set(vin, vehicle);
|
|
510
|
+
return vehicle;
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
export { TessieVehicle, TessieVehicles };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ClimateMode, ClimateModes, Level, Scope, Seat, Seats, Trunk, VehicleDataEndpoint } from "../const.cjs";
|
|
2
|
+
declare namespace commands_d_exports {
|
|
3
|
+
export { AlertTypes, ClimateMode, ClimateModes, CommandResponse, FleetTelemetryConfig, Level, Scope, Seat, Seats, Trunk, VehicleDataEndpoint };
|
|
4
|
+
}
|
|
5
|
+
export interface CommandResponse {
|
|
6
|
+
response: {
|
|
7
|
+
result: boolean;
|
|
8
|
+
reason: string;
|
|
9
|
+
};
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
export type AlertTypes = "customer" | "service";
|
|
13
|
+
export interface FleetTelemetryConfig {
|
|
14
|
+
vins: string[];
|
|
15
|
+
config: {
|
|
16
|
+
hostname: string;
|
|
17
|
+
ca: string;
|
|
18
|
+
fields: {
|
|
19
|
+
[key: string]: {
|
|
20
|
+
interval_seconds: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
alert_types: AlertTypes[];
|
|
24
|
+
exp: number;
|
|
25
|
+
port: number;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export { type ClimateMode, ClimateModes, type Level, type Scope, type Seat, Seats, type Trunk, type VehicleDataEndpoint, commands_d_exports };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ClimateMode, ClimateModes, Level, Scope, Seat, Seats, Trunk, VehicleDataEndpoint } from "../const.mjs";
|
|
2
|
+
declare namespace commands_d_exports {
|
|
3
|
+
export { AlertTypes, ClimateMode, ClimateModes, CommandResponse, FleetTelemetryConfig, Level, Scope, Seat, Seats, Trunk, VehicleDataEndpoint };
|
|
4
|
+
}
|
|
5
|
+
export interface CommandResponse {
|
|
6
|
+
response: {
|
|
7
|
+
result: boolean;
|
|
8
|
+
reason: string;
|
|
9
|
+
};
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
export type AlertTypes = "customer" | "service";
|
|
13
|
+
export interface FleetTelemetryConfig {
|
|
14
|
+
vins: string[];
|
|
15
|
+
config: {
|
|
16
|
+
hostname: string;
|
|
17
|
+
ca: string;
|
|
18
|
+
fields: {
|
|
19
|
+
[key: string]: {
|
|
20
|
+
interval_seconds: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
alert_types: AlertTypes[];
|
|
24
|
+
exp: number;
|
|
25
|
+
port: number;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export { type ClimateMode, ClimateModes, type Level, type Scope, type Seat, Seats, type Trunk, type VehicleDataEndpoint, commands_d_exports };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare namespace live_status_d_exports {
|
|
2
|
+
export { LiveStatusResponse, WallConnector };
|
|
3
|
+
}
|
|
4
|
+
export type LiveStatusResponse = {
|
|
5
|
+
solar_power?: number | null;
|
|
6
|
+
energy_left?: number | null;
|
|
7
|
+
total_pack_energy?: number | null;
|
|
8
|
+
percentage_charged?: number | null;
|
|
9
|
+
backup_capable?: boolean | null;
|
|
10
|
+
battery_power?: number | null;
|
|
11
|
+
load_power?: number | null;
|
|
12
|
+
grid_status?: string | null;
|
|
13
|
+
grid_services_active?: boolean | null;
|
|
14
|
+
grid_power?: number | null;
|
|
15
|
+
grid_services_power?: number | null;
|
|
16
|
+
generator_power?: number | null;
|
|
17
|
+
island_status?: string | null;
|
|
18
|
+
storm_mode_active?: boolean | null;
|
|
19
|
+
timestamp?: Date | null;
|
|
20
|
+
wall_connectors?: WallConnector[] | null;
|
|
21
|
+
};
|
|
22
|
+
export type WallConnector = {
|
|
23
|
+
din: string;
|
|
24
|
+
vin?: string;
|
|
25
|
+
wall_connector_state: number;
|
|
26
|
+
wall_connector_fault_state: number;
|
|
27
|
+
wall_connector_power: number;
|
|
28
|
+
ocpp_status: number;
|
|
29
|
+
};
|
|
30
|
+
export { live_status_d_exports };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare namespace live_status_d_exports {
|
|
2
|
+
export { LiveStatusResponse, WallConnector };
|
|
3
|
+
}
|
|
4
|
+
export type LiveStatusResponse = {
|
|
5
|
+
solar_power?: number | null;
|
|
6
|
+
energy_left?: number | null;
|
|
7
|
+
total_pack_energy?: number | null;
|
|
8
|
+
percentage_charged?: number | null;
|
|
9
|
+
backup_capable?: boolean | null;
|
|
10
|
+
battery_power?: number | null;
|
|
11
|
+
load_power?: number | null;
|
|
12
|
+
grid_status?: string | null;
|
|
13
|
+
grid_services_active?: boolean | null;
|
|
14
|
+
grid_power?: number | null;
|
|
15
|
+
grid_services_power?: number | null;
|
|
16
|
+
generator_power?: number | null;
|
|
17
|
+
island_status?: string | null;
|
|
18
|
+
storm_mode_active?: boolean | null;
|
|
19
|
+
timestamp?: Date | null;
|
|
20
|
+
wall_connectors?: WallConnector[] | null;
|
|
21
|
+
};
|
|
22
|
+
export type WallConnector = {
|
|
23
|
+
din: string;
|
|
24
|
+
vin?: string;
|
|
25
|
+
wall_connector_state: number;
|
|
26
|
+
wall_connector_fault_state: number;
|
|
27
|
+
wall_connector_power: number;
|
|
28
|
+
ocpp_status: number;
|
|
29
|
+
};
|
|
30
|
+
export { live_status_d_exports };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { VehicleResponse } from "./vehicle.cjs";
|
|
2
|
+
import { VehicleConfig } from "./vehicle_data.cjs";
|
|
3
|
+
declare namespace products_d_exports {
|
|
4
|
+
export { Components, EnergyProduct, Features, ProductsData, ProductsResponse, VehicleProduct, WallConnector };
|
|
5
|
+
}
|
|
6
|
+
export type ProductsData = {
|
|
7
|
+
response: ProductsResponse;
|
|
8
|
+
count: number;
|
|
9
|
+
};
|
|
10
|
+
export type ProductsResponse = (VehicleProduct | EnergyProduct)[];
|
|
11
|
+
export type VehicleProduct = VehicleResponse & {
|
|
12
|
+
vehicle_config: VehicleConfig;
|
|
13
|
+
command_signing: string;
|
|
14
|
+
release_notes_supported: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type EnergyProduct = {
|
|
17
|
+
energy_site_id: number;
|
|
18
|
+
resource_type: string;
|
|
19
|
+
site_name: string;
|
|
20
|
+
id: string;
|
|
21
|
+
gateway_id: string;
|
|
22
|
+
asset_site_id: string;
|
|
23
|
+
warp_site_number: string;
|
|
24
|
+
energy_left: number;
|
|
25
|
+
total_pack_energy: number;
|
|
26
|
+
percentage_charged: number;
|
|
27
|
+
battery_type: string;
|
|
28
|
+
backup_capable: boolean;
|
|
29
|
+
battery_power: number;
|
|
30
|
+
go_off_grid_test_banner_enabled: null | boolean;
|
|
31
|
+
storm_mode_enabled: boolean;
|
|
32
|
+
powerwall_onboarding_settings_set: boolean;
|
|
33
|
+
powerwall_tesla_electric_interested_in: null | boolean;
|
|
34
|
+
vpp_tour_enabled: null | boolean;
|
|
35
|
+
sync_grid_alert_enabled: boolean;
|
|
36
|
+
breaker_alert_enabled: boolean;
|
|
37
|
+
components: Components;
|
|
38
|
+
features: Features;
|
|
39
|
+
};
|
|
40
|
+
export type Components = {
|
|
41
|
+
battery: boolean;
|
|
42
|
+
battery_type: string;
|
|
43
|
+
solar: boolean;
|
|
44
|
+
solar_type: string;
|
|
45
|
+
grid: boolean;
|
|
46
|
+
load_meter: boolean;
|
|
47
|
+
market_type: string;
|
|
48
|
+
wall_connectors: WallConnector[];
|
|
49
|
+
};
|
|
50
|
+
export type WallConnector = {
|
|
51
|
+
device_id: string;
|
|
52
|
+
din: string;
|
|
53
|
+
is_active: boolean;
|
|
54
|
+
};
|
|
55
|
+
export type Features = {
|
|
56
|
+
rate_plan_manager_no_pricing_constraint: boolean;
|
|
57
|
+
};
|
|
58
|
+
export { products_d_exports };
|