@teslemetry/api 0.4.0 → 0.5.1
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/index.cjs +160 -24
- package/dist/index.d.cts +274 -170
- package/dist/index.d.mts +274 -170
- package/dist/index.mjs +160 -24
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2,100 +2,130 @@ import { EventEmitter } from "events";
|
|
|
2
2
|
|
|
3
3
|
//#region src/client/types.gen.d.ts
|
|
4
4
|
|
|
5
|
-
type
|
|
5
|
+
type GetApiMetadataResponses = {
|
|
6
6
|
/**
|
|
7
7
|
* Default Response
|
|
8
8
|
*/
|
|
9
9
|
200: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Tesla Unique Identifier
|
|
12
|
+
*/
|
|
13
|
+
uid: string;
|
|
14
|
+
region: 'NA' | 'EU';
|
|
15
|
+
/**
|
|
16
|
+
* List of provided Tesla Fleet API scopes
|
|
17
|
+
*/
|
|
18
|
+
scopes: Array<'openid' | 'offline_access' | 'user_data' | 'vehicle_device_data' | 'vehicle_location' | 'vehicle_cmds' | 'vehicle_charging_cmds' | 'energy_device_data' | 'energy_cmds'>;
|
|
19
|
+
/**
|
|
20
|
+
* Dictionary of available vehicles
|
|
21
|
+
*/
|
|
22
|
+
vehicles: {
|
|
23
|
+
[key: string]: {
|
|
24
|
+
/**
|
|
25
|
+
* Vehicle name
|
|
26
|
+
*/
|
|
27
|
+
name?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Vehicle access type
|
|
30
|
+
*/
|
|
31
|
+
permission?: 'OWNER' | 'DRIVER' | 'GUEST';
|
|
32
|
+
/**
|
|
33
|
+
* Whether the vehicle is proxied through Tesla servers
|
|
34
|
+
*/
|
|
35
|
+
proxy: null | boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the vehicle supports command signing
|
|
38
|
+
*/
|
|
39
|
+
signing: null | boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the user has access to the vehicle
|
|
42
|
+
*/
|
|
43
|
+
access: null | boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the vehicle is being polled for data
|
|
46
|
+
*/
|
|
47
|
+
polling: null | boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Firmware version of the vehicle
|
|
50
|
+
*/
|
|
51
|
+
firmware: null | string;
|
|
52
|
+
/**
|
|
53
|
+
* Discount status
|
|
54
|
+
*/
|
|
55
|
+
discounted: null | boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Fleet Telemetry version running on the vehicle
|
|
58
|
+
*/
|
|
59
|
+
fleet_telemetry: null | string;
|
|
60
|
+
/**
|
|
61
|
+
* Vehicle physical configuration aspects
|
|
62
|
+
*/
|
|
63
|
+
config?: {
|
|
64
|
+
/**
|
|
65
|
+
* Whether the vehicle can accept navigation requests
|
|
66
|
+
*/
|
|
67
|
+
can_accept_navigation_requests?: null | boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Whether the vehicle can actuate trunks
|
|
70
|
+
*/
|
|
71
|
+
can_actuate_trunks?: null | boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Whether cop user set temperature is supported
|
|
74
|
+
*/
|
|
75
|
+
cop_user_set_temp_supported?: null | boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Whether dashcam clip save is supported
|
|
78
|
+
*/
|
|
79
|
+
dashcam_clip_save_supported?: null | boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Whether the vehicle has seat cooling
|
|
82
|
+
*/
|
|
83
|
+
has_seat_cooling?: null | boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Number of rear seat heaters
|
|
86
|
+
*/
|
|
87
|
+
rear_seat_heaters?: null | number;
|
|
88
|
+
/**
|
|
89
|
+
* Whether the vehicle is right hand drive
|
|
90
|
+
*/
|
|
91
|
+
rhd?: null | boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Whether a sun roof is installed
|
|
94
|
+
*/
|
|
95
|
+
sun_roof_installed?: null | boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Whether the vehicle has third row seats
|
|
98
|
+
*/
|
|
99
|
+
third_row_seats?: null | boolean;
|
|
100
|
+
};
|
|
89
101
|
};
|
|
90
|
-
|
|
91
|
-
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Dictionary of available energy sites
|
|
105
|
+
*/
|
|
106
|
+
energy_sites: {
|
|
107
|
+
[key: string]: {
|
|
108
|
+
/**
|
|
109
|
+
* Energy site name
|
|
110
|
+
*/
|
|
111
|
+
name?: string;
|
|
112
|
+
access: null | boolean;
|
|
92
113
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Subscription details
|
|
117
|
+
*/
|
|
118
|
+
subscription: {
|
|
119
|
+
cycle?: string;
|
|
120
|
+
start?: string;
|
|
121
|
+
end?: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* List of VINs with access
|
|
125
|
+
*
|
|
126
|
+
* @deprecated
|
|
127
|
+
*/
|
|
128
|
+
vins: Array<string>;
|
|
99
129
|
};
|
|
100
130
|
};
|
|
101
131
|
type GetApiVehicleConfigByVinResponses = {
|
|
@@ -1193,6 +1223,14 @@ type GetApiConfigByVinResponses = {
|
|
|
1193
1223
|
interval_seconds: number;
|
|
1194
1224
|
resend_interval_seconds?: number;
|
|
1195
1225
|
};
|
|
1226
|
+
/**
|
|
1227
|
+
* The total number of miles driven since the Self-Driving statistics were reset. A reset may occur for certain software updates, car computer replacement, factory reset, or other triggers. (Requires 2025.44.25.5)
|
|
1228
|
+
*/
|
|
1229
|
+
MilesSinceReset?: {
|
|
1230
|
+
interval_seconds: number;
|
|
1231
|
+
resend_interval_seconds?: number;
|
|
1232
|
+
minimum_delta?: number;
|
|
1233
|
+
};
|
|
1196
1234
|
/**
|
|
1197
1235
|
* The miles until arriving at the navigation destination. If no navigation destination is set, Invalid will be returned. (Requires 2024.26)
|
|
1198
1236
|
*/
|
|
@@ -1545,6 +1583,14 @@ type GetApiConfigByVinResponses = {
|
|
|
1545
1583
|
interval_seconds: number;
|
|
1546
1584
|
resend_interval_seconds?: number;
|
|
1547
1585
|
};
|
|
1586
|
+
/**
|
|
1587
|
+
* The total number of miles driven using Full Self-Driving since the Self-Driving statistics were reset. A reset may occur for certain software updates, car computer replacement, factory reset, or other triggers. (Requires 2025.44.25.5)
|
|
1588
|
+
*/
|
|
1589
|
+
SelfDrivingMilesSinceReset?: {
|
|
1590
|
+
interval_seconds: number;
|
|
1591
|
+
resend_interval_seconds?: number;
|
|
1592
|
+
minimum_delta?: number;
|
|
1593
|
+
};
|
|
1548
1594
|
/**
|
|
1549
1595
|
* Status of the Semi passenger seat position. (Requires 2024.26)
|
|
1550
1596
|
*/
|
|
@@ -2996,6 +3042,14 @@ type PatchApiConfigByVinData = {
|
|
|
2996
3042
|
interval_seconds: number;
|
|
2997
3043
|
resend_interval_seconds?: number;
|
|
2998
3044
|
} | null;
|
|
3045
|
+
/**
|
|
3046
|
+
* The total number of miles driven since the Self-Driving statistics were reset. A reset may occur for certain software updates, car computer replacement, factory reset, or other triggers. (Requires 2025.44.25.5)
|
|
3047
|
+
*/
|
|
3048
|
+
MilesSinceReset?: {
|
|
3049
|
+
interval_seconds: number;
|
|
3050
|
+
resend_interval_seconds?: number;
|
|
3051
|
+
minimum_delta?: number;
|
|
3052
|
+
} | null;
|
|
2999
3053
|
/**
|
|
3000
3054
|
* The miles until arriving at the navigation destination. If no navigation destination is set, Invalid will be returned. (Requires 2024.26)
|
|
3001
3055
|
*/
|
|
@@ -3348,6 +3402,14 @@ type PatchApiConfigByVinData = {
|
|
|
3348
3402
|
interval_seconds: number;
|
|
3349
3403
|
resend_interval_seconds?: number;
|
|
3350
3404
|
} | null;
|
|
3405
|
+
/**
|
|
3406
|
+
* The total number of miles driven using Full Self-Driving since the Self-Driving statistics were reset. A reset may occur for certain software updates, car computer replacement, factory reset, or other triggers. (Requires 2025.44.25.5)
|
|
3407
|
+
*/
|
|
3408
|
+
SelfDrivingMilesSinceReset?: {
|
|
3409
|
+
interval_seconds: number;
|
|
3410
|
+
resend_interval_seconds?: number;
|
|
3411
|
+
minimum_delta?: number;
|
|
3412
|
+
} | null;
|
|
3351
3413
|
/**
|
|
3352
3414
|
* Status of the Semi passenger seat position. (Requires 2024.26)
|
|
3353
3415
|
*/
|
|
@@ -4804,6 +4866,14 @@ type PostApiConfigByVinData = {
|
|
|
4804
4866
|
interval_seconds: number;
|
|
4805
4867
|
resend_interval_seconds?: number;
|
|
4806
4868
|
} | null;
|
|
4869
|
+
/**
|
|
4870
|
+
* The total number of miles driven since the Self-Driving statistics were reset. A reset may occur for certain software updates, car computer replacement, factory reset, or other triggers. (Requires 2025.44.25.5)
|
|
4871
|
+
*/
|
|
4872
|
+
MilesSinceReset?: {
|
|
4873
|
+
interval_seconds: number;
|
|
4874
|
+
resend_interval_seconds?: number;
|
|
4875
|
+
minimum_delta?: number;
|
|
4876
|
+
} | null;
|
|
4807
4877
|
/**
|
|
4808
4878
|
* The miles until arriving at the navigation destination. If no navigation destination is set, Invalid will be returned. (Requires 2024.26)
|
|
4809
4879
|
*/
|
|
@@ -5156,6 +5226,14 @@ type PostApiConfigByVinData = {
|
|
|
5156
5226
|
interval_seconds: number;
|
|
5157
5227
|
resend_interval_seconds?: number;
|
|
5158
5228
|
} | null;
|
|
5229
|
+
/**
|
|
5230
|
+
* The total number of miles driven using Full Self-Driving since the Self-Driving statistics were reset. A reset may occur for certain software updates, car computer replacement, factory reset, or other triggers. (Requires 2025.44.25.5)
|
|
5231
|
+
*/
|
|
5232
|
+
SelfDrivingMilesSinceReset?: {
|
|
5233
|
+
interval_seconds: number;
|
|
5234
|
+
resend_interval_seconds?: number;
|
|
5235
|
+
minimum_delta?: number;
|
|
5236
|
+
} | null;
|
|
5159
5237
|
/**
|
|
5160
5238
|
* Status of the Semi passenger seat position. (Requires 2024.26)
|
|
5161
5239
|
*/
|
|
@@ -6703,6 +6781,14 @@ type GetApi1VehiclesByVinFleetTelemetryConfigResponses = {
|
|
|
6703
6781
|
interval_seconds: number;
|
|
6704
6782
|
resend_interval_seconds?: number;
|
|
6705
6783
|
};
|
|
6784
|
+
/**
|
|
6785
|
+
* The total number of miles driven since the Self-Driving statistics were reset. A reset may occur for certain software updates, car computer replacement, factory reset, or other triggers. (Requires 2025.44.25.5)
|
|
6786
|
+
*/
|
|
6787
|
+
MilesSinceReset?: {
|
|
6788
|
+
interval_seconds: number;
|
|
6789
|
+
resend_interval_seconds?: number;
|
|
6790
|
+
minimum_delta?: number;
|
|
6791
|
+
};
|
|
6706
6792
|
/**
|
|
6707
6793
|
* The miles until arriving at the navigation destination. If no navigation destination is set, Invalid will be returned. (Requires 2024.26)
|
|
6708
6794
|
*/
|
|
@@ -7055,6 +7141,14 @@ type GetApi1VehiclesByVinFleetTelemetryConfigResponses = {
|
|
|
7055
7141
|
interval_seconds: number;
|
|
7056
7142
|
resend_interval_seconds?: number;
|
|
7057
7143
|
};
|
|
7144
|
+
/**
|
|
7145
|
+
* The total number of miles driven using Full Self-Driving since the Self-Driving statistics were reset. A reset may occur for certain software updates, car computer replacement, factory reset, or other triggers. (Requires 2025.44.25.5)
|
|
7146
|
+
*/
|
|
7147
|
+
SelfDrivingMilesSinceReset?: {
|
|
7148
|
+
interval_seconds: number;
|
|
7149
|
+
resend_interval_seconds?: number;
|
|
7150
|
+
minimum_delta?: number;
|
|
7151
|
+
};
|
|
7058
7152
|
/**
|
|
7059
7153
|
* Status of the Semi passenger seat position. (Requires 2024.26)
|
|
7060
7154
|
*/
|
|
@@ -8209,6 +8303,7 @@ type GetSseByVin_Responses = {
|
|
|
8209
8303
|
MediaNowPlayingTitle?: string | null;
|
|
8210
8304
|
MediaPlaybackSource?: string | null;
|
|
8211
8305
|
MediaPlaybackStatus?: 'MediaStatusUnknown' | 'MediaStatusStopped' | 'MediaStatusPlaying' | 'MediaStatusPaused' | null;
|
|
8306
|
+
MilesSinceReset?: number | null;
|
|
8212
8307
|
MilesToArrival?: number | null;
|
|
8213
8308
|
MinutesToArrival?: number | null;
|
|
8214
8309
|
ModuleTempMax?: number | null;
|
|
@@ -8259,6 +8354,7 @@ type GetSseByVin_Responses = {
|
|
|
8259
8354
|
SeatHeaterRearRight?: number | null;
|
|
8260
8355
|
SeatHeaterRight?: number | null;
|
|
8261
8356
|
SeatVentEnabled?: boolean | null;
|
|
8357
|
+
SelfDrivingMilesSinceReset?: number | null;
|
|
8262
8358
|
SemitruckPassengerSeatFoldPosition?: 'SeatFoldPositionUnknown' | 'SeatFoldPositionSNA' | 'SeatFoldPositionFaulted' | 'SeatFoldPositionNotConfigured' | 'SeatFoldPositionFolded' | 'SeatFoldPositionUnfolded' | null;
|
|
8263
8359
|
SemitruckTpmsPressureRe1L0?: number | null;
|
|
8264
8360
|
SemitruckTpmsPressureRe1L1?: number | null;
|
|
@@ -9104,6 +9200,11 @@ type GetSseByVin_Responses = {
|
|
|
9104
9200
|
minimum_delta?: number;
|
|
9105
9201
|
resend_interval_seconds?: number;
|
|
9106
9202
|
};
|
|
9203
|
+
MilesSinceReset?: {
|
|
9204
|
+
interval_seconds: number;
|
|
9205
|
+
minimum_delta?: number;
|
|
9206
|
+
resend_interval_seconds?: number;
|
|
9207
|
+
};
|
|
9107
9208
|
MilesToArrival?: {
|
|
9108
9209
|
interval_seconds: number;
|
|
9109
9210
|
minimum_delta?: number;
|
|
@@ -9339,6 +9440,11 @@ type GetSseByVin_Responses = {
|
|
|
9339
9440
|
minimum_delta?: number;
|
|
9340
9441
|
resend_interval_seconds?: number;
|
|
9341
9442
|
};
|
|
9443
|
+
SelfDrivingMilesSinceReset?: {
|
|
9444
|
+
interval_seconds: number;
|
|
9445
|
+
minimum_delta?: number;
|
|
9446
|
+
resend_interval_seconds?: number;
|
|
9447
|
+
};
|
|
9342
9448
|
SemitruckPassengerSeatFoldPosition?: {
|
|
9343
9449
|
interval_seconds: number;
|
|
9344
9450
|
minimum_delta?: number;
|
|
@@ -9911,9 +10017,13 @@ declare interface TeslemetryEnergyApi {
|
|
|
9911
10017
|
emit(event: "siteInfo", data: GetApi1EnergySitesByIdSiteInfoResponse): boolean;
|
|
9912
10018
|
emit(event: "liveStatus", data: GetApi1EnergySitesByIdLiveStatusResponse): boolean;
|
|
9913
10019
|
}
|
|
10020
|
+
type PollingEndpoints = "siteInfo" | "liveStatus";
|
|
9914
10021
|
declare class TeslemetryEnergyApi extends EventEmitter {
|
|
9915
10022
|
private root;
|
|
9916
10023
|
siteId: number;
|
|
10024
|
+
refreshDelay: number;
|
|
10025
|
+
private refreshInterval;
|
|
10026
|
+
private refreshClients;
|
|
9917
10027
|
constructor(root: Teslemetry, siteId: number);
|
|
9918
10028
|
/**
|
|
9919
10029
|
* Adjust the site's backup reserve.
|
|
@@ -10140,6 +10250,7 @@ declare class TeslemetryEnergyApi extends EventEmitter {
|
|
|
10140
10250
|
}>;
|
|
10141
10251
|
};
|
|
10142
10252
|
}>;
|
|
10253
|
+
requestPolling(endpoint: PollingEndpoints): () => void;
|
|
10143
10254
|
}
|
|
10144
10255
|
//#endregion
|
|
10145
10256
|
//#region src/TeslemetryVehicleApi.d.ts
|
|
@@ -10375,16 +10486,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10375
10486
|
resend_interval_seconds?: number;
|
|
10376
10487
|
minimum_delta?: number;
|
|
10377
10488
|
};
|
|
10378
|
-
BlindSpotCollisionWarningChime
|
|
10379
|
-
/**
|
|
10380
|
-
* Get the streaming configuration for a specific vehicle.
|
|
10381
|
-
* @return Promise to an object with response containing the streaming configuration
|
|
10382
|
-
*/?
|
|
10383
|
-
/**
|
|
10384
|
-
* Get the streaming configuration for a specific vehicle.
|
|
10385
|
-
* @return Promise to an object with response containing the streaming configuration
|
|
10386
|
-
*/
|
|
10387
|
-
: {
|
|
10489
|
+
BlindSpotCollisionWarningChime?: {
|
|
10388
10490
|
interval_seconds: number;
|
|
10389
10491
|
resend_interval_seconds?: number;
|
|
10390
10492
|
};
|
|
@@ -10449,7 +10551,11 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10449
10551
|
ChargeLimitSoc?: {
|
|
10450
10552
|
interval_seconds: number;
|
|
10451
10553
|
resend_interval_seconds?: number;
|
|
10452
|
-
minimum_delta
|
|
10554
|
+
minimum_delta
|
|
10555
|
+
/**
|
|
10556
|
+
* Wakes the vehicle from sleep. This command costs 20 command credits
|
|
10557
|
+
* @return Promise to an object with response containing wake up confirmation
|
|
10558
|
+
*/?
|
|
10453
10559
|
/**
|
|
10454
10560
|
* Wakes the vehicle from sleep. This command costs 20 command credits
|
|
10455
10561
|
* @return Promise to an object with response containing wake up confirmation
|
|
@@ -10539,7 +10645,11 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10539
10645
|
};
|
|
10540
10646
|
DefrostForPreconditioning?: {
|
|
10541
10647
|
interval_seconds: number;
|
|
10542
|
-
resend_interval_seconds
|
|
10648
|
+
resend_interval_seconds
|
|
10649
|
+
/**
|
|
10650
|
+
* Skips to the next favorite in media playback.
|
|
10651
|
+
* @return Promise to an object with response containing media next favorite result
|
|
10652
|
+
*/?
|
|
10543
10653
|
/**
|
|
10544
10654
|
* Skips to the next favorite in media playback.
|
|
10545
10655
|
* @return Promise to an object with response containing media next favorite result
|
|
@@ -10585,18 +10695,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10585
10695
|
DiHeatsinkTF?: {
|
|
10586
10696
|
interval_seconds: number;
|
|
10587
10697
|
resend_interval_seconds?: number;
|
|
10588
|
-
minimum_delta
|
|
10589
|
-
/**
|
|
10590
|
-
* Sets the vehicle name.
|
|
10591
|
-
* @param vehicle_name The new vehicle name
|
|
10592
|
-
* @return Promise to an object with response containing vehicle name set result
|
|
10593
|
-
*/?
|
|
10594
|
-
/**
|
|
10595
|
-
* Sets the vehicle name.
|
|
10596
|
-
* @param vehicle_name The new vehicle name
|
|
10597
|
-
* @return Promise to an object with response containing vehicle name set result
|
|
10598
|
-
*/
|
|
10599
|
-
: number;
|
|
10698
|
+
minimum_delta?: number;
|
|
10600
10699
|
};
|
|
10601
10700
|
DiHeatsinkTR?: {
|
|
10602
10701
|
interval_seconds: number;
|
|
@@ -10611,14 +10710,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10611
10710
|
DiHeatsinkTRER?: {
|
|
10612
10711
|
interval_seconds: number;
|
|
10613
10712
|
resend_interval_seconds?: number;
|
|
10614
|
-
minimum_delta
|
|
10615
|
-
/**
|
|
10616
|
-
* Controls vehicle windows.
|
|
10617
|
-
* @param command The window control command
|
|
10618
|
-
* @param lat Latitude
|
|
10619
|
-
* @param lon Longitude
|
|
10620
|
-
* @return Promise to an object with response containing window control result
|
|
10621
|
-
*/?: number;
|
|
10713
|
+
minimum_delta?: number;
|
|
10622
10714
|
};
|
|
10623
10715
|
DiInverterTF?: {
|
|
10624
10716
|
interval_seconds: number;
|
|
@@ -10842,12 +10934,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10842
10934
|
HomelinkDeviceCount?: {
|
|
10843
10935
|
interval_seconds: number;
|
|
10844
10936
|
resend_interval_seconds?: number;
|
|
10845
|
-
minimum_delta
|
|
10846
|
-
/**
|
|
10847
|
-
* Sets sentry mode.
|
|
10848
|
-
* @param on Whether to enable sentry mode
|
|
10849
|
-
* @return Promise to an object with response containing sentry mode set result
|
|
10850
|
-
*/?: number;
|
|
10937
|
+
minimum_delta?: number;
|
|
10851
10938
|
};
|
|
10852
10939
|
HomelinkNearby?: {
|
|
10853
10940
|
interval_seconds: number;
|
|
@@ -10866,13 +10953,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10866
10953
|
resend_interval_seconds?: number;
|
|
10867
10954
|
minimum_delta?: number;
|
|
10868
10955
|
};
|
|
10869
|
-
HvacFanStatus
|
|
10870
|
-
/**
|
|
10871
|
-
* Sets PIN to drive.
|
|
10872
|
-
* @param on Whether to enable PIN to drive
|
|
10873
|
-
* @param password The PIN password
|
|
10874
|
-
* @return Promise to an object with response containing PIN to drive set result
|
|
10875
|
-
*/?: {
|
|
10956
|
+
HvacFanStatus?: {
|
|
10876
10957
|
interval_seconds: number;
|
|
10877
10958
|
resend_interval_seconds?: number;
|
|
10878
10959
|
minimum_delta?: number;
|
|
@@ -10940,12 +11021,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
10940
11021
|
};
|
|
10941
11022
|
LifetimeEnergyUsedDrive?: {
|
|
10942
11023
|
interval_seconds: number;
|
|
10943
|
-
resend_interval_seconds
|
|
10944
|
-
/**
|
|
10945
|
-
* Sends a navigation request.
|
|
10946
|
-
* @param body The navigation request configuration
|
|
10947
|
-
* @return Promise to an object with response containing navigation request result
|
|
10948
|
-
*/?: number;
|
|
11024
|
+
resend_interval_seconds?: number;
|
|
10949
11025
|
minimum_delta?: number;
|
|
10950
11026
|
};
|
|
10951
11027
|
LightsHazardsActive?: {
|
|
@@ -11034,6 +11110,11 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
11034
11110
|
interval_seconds: number;
|
|
11035
11111
|
resend_interval_seconds?: number;
|
|
11036
11112
|
};
|
|
11113
|
+
MilesSinceReset?: {
|
|
11114
|
+
interval_seconds: number;
|
|
11115
|
+
resend_interval_seconds?: number;
|
|
11116
|
+
minimum_delta?: number;
|
|
11117
|
+
};
|
|
11037
11118
|
MilesToArrival?: {
|
|
11038
11119
|
interval_seconds: number;
|
|
11039
11120
|
resend_interval_seconds?: number;
|
|
@@ -11065,15 +11146,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
11065
11146
|
};
|
|
11066
11147
|
NumBrickVoltageMin?: {
|
|
11067
11148
|
interval_seconds: number;
|
|
11068
|
-
resend_interval_seconds
|
|
11069
|
-
/**
|
|
11070
|
-
* Starts a light show.
|
|
11071
|
-
* @param show_index The light show index
|
|
11072
|
-
* @param start_time Optional start time for the light show
|
|
11073
|
-
* @param volume Optional volume level for the light show
|
|
11074
|
-
* @param dance_moves Optional flag to enable dance moves
|
|
11075
|
-
* @return Promise to an object with response containing light show start result
|
|
11076
|
-
*/?: number;
|
|
11149
|
+
resend_interval_seconds?: number;
|
|
11077
11150
|
minimum_delta?: number;
|
|
11078
11151
|
};
|
|
11079
11152
|
NumModuleTempMax?: {
|
|
@@ -11091,12 +11164,7 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
11091
11164
|
resend_interval_seconds?: number;
|
|
11092
11165
|
minimum_delta?: number;
|
|
11093
11166
|
};
|
|
11094
|
-
OffroadLightbarPresent
|
|
11095
|
-
/**
|
|
11096
|
-
* Removes all impermanent keys from the vehicle.
|
|
11097
|
-
* @return Promise to an object with response containing impermanent key removal result
|
|
11098
|
-
*/
|
|
11099
|
-
: {
|
|
11167
|
+
OffroadLightbarPresent?: {
|
|
11100
11168
|
interval_seconds: number;
|
|
11101
11169
|
resend_interval_seconds?: number;
|
|
11102
11170
|
};
|
|
@@ -11106,7 +11174,12 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
11106
11174
|
};
|
|
11107
11175
|
OutsideTemp?: {
|
|
11108
11176
|
interval_seconds: number;
|
|
11109
|
-
resend_interval_seconds
|
|
11177
|
+
resend_interval_seconds?
|
|
11178
|
+
/**
|
|
11179
|
+
* Returns vehicle option details.
|
|
11180
|
+
* @return Promise to an object with response containing vehicle options
|
|
11181
|
+
*/
|
|
11182
|
+
: number;
|
|
11110
11183
|
minimum_delta?: number;
|
|
11111
11184
|
};
|
|
11112
11185
|
PackCurrent?: {
|
|
@@ -11258,6 +11331,11 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
11258
11331
|
interval_seconds: number;
|
|
11259
11332
|
resend_interval_seconds?: number;
|
|
11260
11333
|
};
|
|
11334
|
+
SelfDrivingMilesSinceReset?: {
|
|
11335
|
+
interval_seconds: number;
|
|
11336
|
+
resend_interval_seconds?: number;
|
|
11337
|
+
minimum_delta?: number;
|
|
11338
|
+
};
|
|
11261
11339
|
SemitruckPassengerSeatFoldPosition?: {
|
|
11262
11340
|
interval_seconds: number;
|
|
11263
11341
|
resend_interval_seconds?: number;
|
|
@@ -12293,6 +12371,11 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
12293
12371
|
interval_seconds: number;
|
|
12294
12372
|
resend_interval_seconds?: number;
|
|
12295
12373
|
};
|
|
12374
|
+
MilesSinceReset?: {
|
|
12375
|
+
interval_seconds: number;
|
|
12376
|
+
resend_interval_seconds?: number;
|
|
12377
|
+
minimum_delta?: number;
|
|
12378
|
+
};
|
|
12296
12379
|
MilesToArrival?: {
|
|
12297
12380
|
interval_seconds: number;
|
|
12298
12381
|
resend_interval_seconds?: number;
|
|
@@ -12504,6 +12587,11 @@ declare class TeslemetryVehicleApi extends EventEmitter {
|
|
|
12504
12587
|
interval_seconds: number;
|
|
12505
12588
|
resend_interval_seconds?: number;
|
|
12506
12589
|
};
|
|
12590
|
+
SelfDrivingMilesSinceReset?: {
|
|
12591
|
+
interval_seconds: number;
|
|
12592
|
+
resend_interval_seconds?: number;
|
|
12593
|
+
minimum_delta?: number;
|
|
12594
|
+
};
|
|
12507
12595
|
SemitruckPassengerSeatFoldPosition?: {
|
|
12508
12596
|
interval_seconds: number;
|
|
12509
12597
|
resend_interval_seconds?: number;
|
|
@@ -13726,25 +13814,20 @@ type SseConfig = ExtractSse<{
|
|
|
13726
13814
|
type FieldsResponse = GetApiConfigByVinResponses[200]["fields"];
|
|
13727
13815
|
type FieldsRequest = NonNullable<NonNullable<PatchApiConfigByVinData["body"]>["fields"]>;
|
|
13728
13816
|
type Signals = keyof SseData["data"];
|
|
13729
|
-
type
|
|
13730
|
-
type
|
|
13731
|
-
device_type: "vehicle";
|
|
13732
|
-
}>;
|
|
13733
|
-
type EnergyProduct = Extract<ProductsResponse[number], {
|
|
13734
|
-
device_type: "energy";
|
|
13735
|
-
}>;
|
|
13817
|
+
type VehicleMetadata = GetApiMetadataResponses[200]["vehicles"][string];
|
|
13818
|
+
type EnergyMetadata = GetApiMetadataResponses[200]["energy_sites"][string];
|
|
13736
13819
|
interface VehicleDetails {
|
|
13737
|
-
name: string;
|
|
13738
13820
|
vin: string;
|
|
13821
|
+
name: string;
|
|
13739
13822
|
api: TeslemetryVehicleApi;
|
|
13740
13823
|
sse: TeslemetryVehicleStream;
|
|
13741
|
-
|
|
13824
|
+
metadata: VehicleMetadata;
|
|
13742
13825
|
}
|
|
13743
13826
|
interface EnergyDetails {
|
|
13827
|
+
id: number;
|
|
13744
13828
|
name: string;
|
|
13745
|
-
site: number;
|
|
13746
13829
|
api: TeslemetryEnergyApi;
|
|
13747
|
-
|
|
13830
|
+
metadata: EnergyMetadata;
|
|
13748
13831
|
}
|
|
13749
13832
|
interface Products {
|
|
13750
13833
|
vehicles: Record<string, VehicleDetails>;
|
|
@@ -13826,7 +13909,10 @@ declare class TeslemetryVehicleStream extends EventEmitter {
|
|
|
13826
13909
|
//#region src/TeslemetryStream.d.ts
|
|
13827
13910
|
interface TeslemetryStreamOptions {
|
|
13828
13911
|
vin?: string;
|
|
13829
|
-
cache?: boolean
|
|
13912
|
+
cache?: boolean | {
|
|
13913
|
+
cloud: boolean;
|
|
13914
|
+
local: boolean;
|
|
13915
|
+
};
|
|
13830
13916
|
}
|
|
13831
13917
|
type TeslemetryStreamEventMap = {
|
|
13832
13918
|
state: SseState;
|
|
@@ -13846,15 +13932,26 @@ declare interface TeslemetryStream {
|
|
|
13846
13932
|
off<K$1 extends keyof TeslemetryStreamEventMap>(event: K$1, listener: (data: TeslemetryStreamEventMap[K$1]) => void): this;
|
|
13847
13933
|
emit<K$1 extends keyof TeslemetryStreamEventMap>(event: K$1, ...args: TeslemetryStreamEventMap[K$1] extends void ? [] : [TeslemetryStreamEventMap[K$1]]): boolean;
|
|
13848
13934
|
}
|
|
13935
|
+
interface VehicleCache {
|
|
13936
|
+
state?: SseState["state"];
|
|
13937
|
+
data?: SseData["data"];
|
|
13938
|
+
alerts?: SseAlerts["alerts"];
|
|
13939
|
+
errors?: SseErrors["errors"];
|
|
13940
|
+
connectivity?: Partial<Record<SseConnectivity["networkInterface"], SseConnectivity["status"]>>;
|
|
13941
|
+
}
|
|
13942
|
+
type Cache = Record<string, VehicleCache>;
|
|
13849
13943
|
declare class TeslemetryStream extends EventEmitter {
|
|
13850
13944
|
private root;
|
|
13851
13945
|
active: boolean;
|
|
13852
13946
|
connected: boolean;
|
|
13853
13947
|
private vin;
|
|
13854
|
-
|
|
13948
|
+
cache: Cache;
|
|
13949
|
+
private cloudCache;
|
|
13950
|
+
private localCache;
|
|
13855
13951
|
logger: Logger;
|
|
13856
13952
|
vehicles: Map<string, TeslemetryVehicleStream>;
|
|
13857
13953
|
constructor(root: Teslemetry, options?: TeslemetryStreamOptions);
|
|
13954
|
+
sendCache<K$1 extends keyof TeslemetryStreamEventMap>(vin: string, event: K$1, listener: (data: any) => void): void;
|
|
13858
13955
|
getVehicle(vin: string): TeslemetryVehicleStream;
|
|
13859
13956
|
connect(): Promise<void>;
|
|
13860
13957
|
private _connectLoop;
|
|
@@ -13862,6 +13959,13 @@ declare class TeslemetryStream extends EventEmitter {
|
|
|
13862
13959
|
close(): void;
|
|
13863
13960
|
parseCreatedAt(event: SseEvent): Date;
|
|
13864
13961
|
private _dispatch;
|
|
13962
|
+
private cacheState;
|
|
13963
|
+
private cacheData;
|
|
13964
|
+
private cacheErrors;
|
|
13965
|
+
private cacheAlerts;
|
|
13966
|
+
private cacheConnectivity;
|
|
13967
|
+
startLocalCache(): void;
|
|
13968
|
+
stopLocalCache(): void;
|
|
13865
13969
|
}
|
|
13866
13970
|
//#endregion
|
|
13867
13971
|
//#region src/TeslemetryChargingApi.d.ts
|
|
@@ -14149,13 +14253,13 @@ declare class TeslemetryApi {
|
|
|
14149
14253
|
};
|
|
14150
14254
|
};
|
|
14151
14255
|
};
|
|
14152
|
-
energy_sites
|
|
14256
|
+
energy_sites: {
|
|
14153
14257
|
[key: string]: {
|
|
14154
14258
|
name?: string;
|
|
14155
14259
|
access: null | boolean;
|
|
14156
14260
|
};
|
|
14157
14261
|
};
|
|
14158
|
-
subscription
|
|
14262
|
+
subscription: {
|
|
14159
14263
|
cycle?: string;
|
|
14160
14264
|
start?: string;
|
|
14161
14265
|
end?: string;
|