tesla_api 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/apiary.apib +0 -710
  3. data/docs/SUMMARY.md +9 -5
  4. data/docs/api-basics/vehicles.md +2 -0
  5. data/docs/miscellaneous/README.md +9 -0
  6. data/docs/miscellaneous/endpoints.md +407 -0
  7. data/docs/vehicle/commands/README.md +45 -4
  8. data/docs/vehicle/commands/alerts.md +24 -0
  9. data/docs/vehicle/commands/charging.md +97 -0
  10. data/docs/vehicle/commands/climate.md +46 -0
  11. data/docs/vehicle/commands/doors.md +24 -0
  12. data/docs/vehicle/commands/media.md +92 -0
  13. data/docs/vehicle/commands/navigation.md +33 -0
  14. data/docs/vehicle/commands/remotestart.md +17 -0
  15. data/docs/vehicle/commands/softwareupdate.md +30 -0
  16. data/docs/vehicle/commands/speedlimit.md +74 -0
  17. data/docs/vehicle/commands/sunroof.md +19 -0
  18. data/docs/vehicle/commands/trunk.md +17 -0
  19. data/docs/vehicle/commands/valet.md +35 -0
  20. data/docs/vehicle/commands/wake.md +26 -0
  21. data/docs/vehicle/optioncodes.md +4 -0
  22. data/docs/vehicle/state/README.md +5 -1
  23. data/docs/vehicle/state/chargestate.md +35 -36
  24. data/docs/vehicle/state/climatestate.md +19 -20
  25. data/docs/vehicle/state/data.md +122 -108
  26. data/docs/vehicle/state/drivestate.md +7 -8
  27. data/docs/vehicle/state/guisettings.md +4 -5
  28. data/docs/vehicle/state/nearbychargingsites.md +12 -0
  29. data/docs/vehicle/state/vehiclestate.md +10 -7
  30. data/lib/tesla_api/vehicle.rb +25 -0
  31. data/lib/tesla_api/version.rb +1 -1
  32. data/spec/cassettes/vehicle-cancel_software_update.yml +100 -0
  33. data/spec/cassettes/vehicle-charge_port_door_close.yml +100 -0
  34. data/spec/cassettes/vehicle-data.yml +103 -0
  35. data/spec/cassettes/vehicle-navigation_request.yml +100 -0
  36. data/spec/cassettes/vehicle-nearby_charging_sites.yml +95 -0
  37. data/spec/cassettes/vehicle-schedule_software_update.yml +100 -0
  38. data/spec/lib/tesla_api/vehicle_spec.rb +47 -22
  39. metadata +18 -13
  40. data/spec/cassettes/vehicle-sun_roof_control-comfort.yml +0 -130
  41. data/spec/cassettes/vehicle-sun_roof_control-open.yml +0 -130
  42. data/spec/cassettes/vehicle-sun_roof_move-0.yml +0 -130
  43. data/spec/cassettes/vehicle-sun_roof_move-100.yml +0 -130
  44. data/spec/cassettes/vehicle-sun_roof_move-50.yml +0 -130
@@ -17,23 +17,27 @@
17
17
  * [GUI Settings](vehicle/state/guisettings.md)
18
18
  * [Vehicle State](vehicle/state/vehiclestate.md)
19
19
  * [Mobile Enabled](vehicle/state/mobileenabled.md)
20
+ * [Nearby Charging Sites](vehicle/state/nearbychargingsites.md)
20
21
  * [Commands](vehicle/commands/README.md)
21
22
  * [Wake](vehicle/commands/wake.md)
22
23
  * [Alerts](vehicle/commands/alerts.md)
24
+ * [Remote Start](vehicle/commands/remotestart.md)
25
+ * [Speed Limit](vehicle/commands/speedlimit.md)
26
+ * [Valet Mode](vehicle/commands/valet.md)
23
27
  * [Doors](vehicle/commands/doors.md)
24
28
  * [Frunk/Trunk](vehicle/commands/trunk.md)
25
29
  * [Sunroof](vehicle/commands/sunroof.md)
26
30
  * [Charging](vehicle/commands/charging.md)
27
31
  * [Climate](vehicle/commands/climate.md)
28
32
  * [Media](vehicle/commands/media.md)
29
- * [Navigation](vehicle/commands/nagivation.md)
30
- * [Remote Start](vehicle/commands/remotestart.md)
33
+ * [Navigation](vehicle/commands/navigation.md)
31
34
  * [Software Updates](vehicle/commands/softwareupdate.md)
32
- * [Speed Limit](vehicle/commands/speedlimit.md)
33
- * [Valet Mode](vehicle/commands/valet.md)
34
35
  * [Calendar](vehicle/commands/calendar.md)
35
-
36
36
  * [Streaming](vehicle/streaming.md)
37
37
  * [Autopark/Summon](vehicle/autopark.md)
38
38
  * [Option Codes](vehicle/optioncodes.md)
39
39
 
40
+ ## Miscellaneous
41
+
42
+ * [Endpoints File](miscellaneous/endpoints.md)
43
+
@@ -35,6 +35,7 @@ Retrieve a list of your owned vehicles (includes vehicles not yet shipped!)
35
35
  "in_service": false,
36
36
  "id_s": "12345678901234567",
37
37
  "calendar_enabled": true,
38
+ "api_version": 4,
38
39
  "backseat_token": null,
39
40
  "backseat_token_updated_at": null
40
41
  }
@@ -69,6 +70,7 @@ These resources are read-only and determine the state of the vehicle's various s
69
70
  "in_service": false,
70
71
  "id_s": "12345678901234567",
71
72
  "calendar_enabled": true,
73
+ "api_version": 4,
72
74
  "backseat_token": null,
73
75
  "backseat_token_updated_at": null
74
76
  }
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: Miscellaneous API information
3
+ ---
4
+
5
+ # Miscellaneous API information
6
+
7
+ {% page-ref page="endpoints.md" %}
8
+
9
+ Contents of the endpoints file from the mobile app.
@@ -0,0 +1,407 @@
1
+ # Endpoints File
2
+
3
+ This the latest contents of the ownerapi_endpoints.json file from the 3.7.0 version of the app.
4
+
5
+ ```json
6
+ {
7
+ "AUTHENTICATE": {
8
+ "TYPE": "POST",
9
+ "URI": "oauth/token",
10
+ "AUTH": false
11
+ },
12
+ "REVOKE_AUTH_TOKEN": {
13
+ "TYPE": "POST",
14
+ "URI": "oauth/revoke",
15
+ "AUTH": true
16
+ },
17
+ "PRODUCT_LIST": {
18
+ "TYPE": "GET",
19
+ "URI": "api/1/products",
20
+ "AUTH": true
21
+ },
22
+ "VEHICLE_LIST": {
23
+ "TYPE": "GET",
24
+ "URI": "api/1/vehicles",
25
+ "AUTH": true
26
+ },
27
+ "VEHICLE_SUMMARY": {
28
+ "TYPE": "GET",
29
+ "URI": "api/1/vehicles/{vehicle_id}",
30
+ "AUTH": true
31
+ },
32
+ "VEHICLE_DATA_LEGACY": {
33
+ "TYPE": "GET",
34
+ "URI": "api/1/vehicles/{vehicle_id}/data",
35
+ "AUTH": true
36
+ },
37
+ "VEHICLE_DATA": {
38
+ "TYPE": "GET",
39
+ "URI": "api/1/vehicles/{vehicle_id}/vehicle_data",
40
+ "AUTH": true
41
+ },
42
+ "NEARBY_CHARGING_SITES": {
43
+ "TYPE": "GET",
44
+ "URI": "api/1/vehicles/{vehicle_id}/nearby_charging_sites",
45
+ "AUTH": true
46
+ },
47
+ "WAKE_UP": {
48
+ "TYPE": "POST",
49
+ "URI": "api/1/vehicles/{vehicle_id}/wake_up",
50
+ "AUTH": true
51
+ },
52
+ "UNLOCK": {
53
+ "TYPE": "POST",
54
+ "URI": "api/1/vehicles/{vehicle_id}/command/door_unlock",
55
+ "AUTH": true
56
+ },
57
+ "LOCK": {
58
+ "TYPE": "POST",
59
+ "URI": "api/1/vehicles/{vehicle_id}/command/door_lock",
60
+ "AUTH": true
61
+ },
62
+ "HONK_HORN": {
63
+ "TYPE": "POST",
64
+ "URI": "api/1/vehicles/{vehicle_id}/command/honk_horn",
65
+ "AUTH": true
66
+ },
67
+ "FLASH_LIGHTS": {
68
+ "TYPE": "POST",
69
+ "URI": "api/1/vehicles/{vehicle_id}/command/flash_lights",
70
+ "AUTH": true
71
+ },
72
+ "CLIMATE_ON": {
73
+ "TYPE": "POST",
74
+ "URI": "api/1/vehicles/{vehicle_id}/command/auto_conditioning_start",
75
+ "AUTH": true
76
+ },
77
+ "CLIMATE_OFF": {
78
+ "TYPE": "POST",
79
+ "URI": "api/1/vehicles/{vehicle_id}/command/auto_conditioning_stop",
80
+ "AUTH": true
81
+ },
82
+ "CHANGE_CLIMATE_TEMPERATURE_SETTING": {
83
+ "TYPE": "POST",
84
+ "URI": "api/1/vehicles/{vehicle_id}/command/set_temps",
85
+ "AUTH": true
86
+ },
87
+ "CHANGE_CHARGE_LIMIT": {
88
+ "TYPE": "POST",
89
+ "URI": "api/1/vehicles/{vehicle_id}/command/set_charge_limit",
90
+ "AUTH": true
91
+ },
92
+ "CHANGE_SUNROOF_STATE": {
93
+ "TYPE": "POST",
94
+ "URI": "api/1/vehicles/{vehicle_id}/command/sun_roof_control",
95
+ "AUTH": true
96
+ },
97
+ "ACTUATE_TRUNK": {
98
+ "TYPE": "POST",
99
+ "URI": "api/1/vehicles/{vehicle_id}/command/actuate_trunk",
100
+ "AUTH": true
101
+ },
102
+ "REMOTE_START": {
103
+ "TYPE": "POST",
104
+ "URI": "api/1/vehicles/{vehicle_id}/command/remote_start_drive",
105
+ "AUTH": true
106
+ },
107
+ "CHARGE_PORT_DOOR_OPEN": {
108
+ "TYPE": "POST",
109
+ "URI": "api/1/vehicles/{vehicle_id}/command/charge_port_door_open",
110
+ "AUTH": true
111
+ },
112
+ "CHARGE_PORT_DOOR_CLOSE": {
113
+ "TYPE": "POST",
114
+ "URI": "api/1/vehicles/{vehicle_id}/command/charge_port_door_close",
115
+ "AUTH": true
116
+ },
117
+ "START_CHARGE": {
118
+ "TYPE": "POST",
119
+ "URI": "api/1/vehicles/{vehicle_id}/command/charge_start",
120
+ "AUTH": true
121
+ },
122
+ "STOP_CHARGE": {
123
+ "TYPE": "POST",
124
+ "URI": "api/1/vehicles/{vehicle_id}/command/charge_stop",
125
+ "AUTH": true
126
+ },
127
+ "MEDIA_TOGGLE_PLAYBACK": {
128
+ "TYPE": "POST",
129
+ "URI": "api/1/vehicles/{vehicle_id}/command/media_toggle_playback",
130
+ "AUTH": true
131
+ },
132
+ "MEDIA_NEXT_TRACK": {
133
+ "TYPE": "POST",
134
+ "URI": "api/1/vehicles/{vehicle_id}/command/media_next_track",
135
+ "AUTH": true
136
+ },
137
+ "MEDIA_PREVIOUS_TRACK": {
138
+ "TYPE": "POST",
139
+ "URI": "api/1/vehicles/{vehicle_id}/command/media_prev_track",
140
+ "AUTH": true
141
+ },
142
+ "MEDIA_NEXT_FAVORITE": {
143
+ "TYPE": "POST",
144
+ "URI": "api/1/vehicles/{vehicle_id}/command/media_next_fav",
145
+ "AUTH": true
146
+ },
147
+ "MEDIA_PREVIOUS_FAVORITE": {
148
+ "TYPE": "POST",
149
+ "URI": "api/1/vehicles/{vehicle_id}/command/media_prev_fav",
150
+ "AUTH": true
151
+ },
152
+ "MEDIA_VOLUME_UP": {
153
+ "TYPE": "POST",
154
+ "URI": "api/1/vehicles/{vehicle_id}/command/media_volume_up",
155
+ "AUTH": true
156
+ },
157
+ "MEDIA_VOLUME_DOWN": {
158
+ "TYPE": "POST",
159
+ "URI": "api/1/vehicles/{vehicle_id}/command/media_volume_down",
160
+ "AUTH": true
161
+ },
162
+ "SEND_LOG": {
163
+ "TYPE": "POST",
164
+ "URI": "api/1/logs",
165
+ "AUTH": true
166
+ },
167
+ "RETRIEVE_NOTIFICATION_PREFERENCES": {
168
+ "TYPE": "GET",
169
+ "URI": "api/1/notification_preferences",
170
+ "AUTH": true
171
+ },
172
+ "SEND_NOTIFICATION_PREFERENCES": {
173
+ "TYPE": "POST",
174
+ "URI": "api/1/notification_preferences",
175
+ "AUTH": true
176
+ },
177
+ "RETRIEVE_NOTIFICATION_SUBSCRIPTION_PREFERENCES": {
178
+ "TYPE": "GET",
179
+ "URI": "api/1/vehicle_subscriptions",
180
+ "AUTH": true
181
+ },
182
+ "SEND_NOTIFICATION_SUBSCRIPTION_PREFERENCES": {
183
+ "TYPE": "POST",
184
+ "URI": "api/1/vehicle_subscriptions",
185
+ "AUTH": true
186
+ },
187
+ "DEACTIVATE_DEVICE_TOKEN": {
188
+ "TYPE": "POST",
189
+ "URI": "api/1/device/{device_token}/deactivate",
190
+ "AUTH": true
191
+ },
192
+ "CALENDAR_SYNC": {
193
+ "TYPE": "POST",
194
+ "URI": "api/1/vehicles/{vehicle_id}/command/upcoming_calendar_entries",
195
+ "AUTH": true
196
+ },
197
+ "SET_VALET_MODE": {
198
+ "TYPE": "POST",
199
+ "URI": "api/1/vehicles/{vehicle_id}/command/set_valet_mode",
200
+ "AUTH": true
201
+ },
202
+ "RESET_VALET_PIN": {
203
+ "TYPE": "POST",
204
+ "URI": "api/1/vehicles/{vehicle_id}/command/reset_valet_pin",
205
+ "AUTH": true
206
+ },
207
+ "SPEED_LIMIT_ACTIVATE": {
208
+ "TYPE": "POST",
209
+ "URI": "api/1/vehicles/{vehicle_id}/command/speed_limit_activate",
210
+ "AUTH": true
211
+ },
212
+ "SPEED_LIMIT_DEACTIVATE": {
213
+ "TYPE": "POST",
214
+ "URI": "api/1/vehicles/{vehicle_id}/command/speed_limit_deactivate",
215
+ "AUTH": true
216
+ },
217
+ "SPEED_LIMIT_SET_LIMIT": {
218
+ "TYPE": "POST",
219
+ "URI": "api/1/vehicles/{vehicle_id}/command/speed_limit_set_limit",
220
+ "AUTH": true
221
+ },
222
+ "SPEED_LIMIT_CLEAR_PIN": {
223
+ "TYPE": "POST",
224
+ "URI": "api/1/vehicles/{vehicle_id}/command/speed_limit_clear_pin",
225
+ "AUTH": true
226
+ },
227
+ "SCHEDULE_SOFTWARE_UPDATE": {
228
+ "TYPE": "POST",
229
+ "URI": "api/1/vehicles/{vehicle_id}/command/schedule_software_update",
230
+ "AUTH": true
231
+ },
232
+ "CANCEL_SOFTWARE_UPDATE": {
233
+ "TYPE": "POST",
234
+ "URI": "api/1/vehicles/{vehicle_id}/command/cancel_software_update",
235
+ "AUTH": true
236
+ },
237
+ "POWERWALL_ORDER_SESSION_DATA": {
238
+ "TYPE": "GET",
239
+ "URI": "api/1/users/powerwall_order_entry_data",
240
+ "AUTH": true
241
+ },
242
+ "POWERWALL_ORDER_PAGE": {
243
+ "TYPE": "GET",
244
+ "URI": "powerwall_order_page",
245
+ "AUTH": true,
246
+ "CONTENT": "HTML"
247
+ },
248
+ "ONBOARDING_EXPERIENCE": {
249
+ "TYPE": "GET",
250
+ "URI": "api/1/users/onboarding_data",
251
+ "AUTH": true
252
+ },
253
+ "ONBOARDING_EXPERIENCE_PAGE": {
254
+ "TYPE": "GET",
255
+ "URI": "onboarding_page",
256
+ "AUTH": true,
257
+ "CONTENT": "HTML"
258
+ },
259
+ "REFERRAL_DATA": {
260
+ "TYPE": "GET",
261
+ "URI": "api/1/users/referral_data",
262
+ "AUTH": true
263
+ },
264
+ "REFERRAL_PAGE": {
265
+ "TYPE": "GET",
266
+ "URI": "referral_page",
267
+ "AUTH": true,
268
+ "CONTENT": "HTML"
269
+ },
270
+ "MESSAGE_CENTER_MESSAGE_LIST": {
271
+ "TYPE": "GET",
272
+ "URI": "api/1/messages",
273
+ "AUTH": true
274
+ },
275
+ "MESSAGE_CENTER_MESSAGE": {
276
+ "TYPE": "GET",
277
+ "URI": "api/1/messages/{message_id}",
278
+ "AUTH": true
279
+ },
280
+ "MESSAGE_CENTER_COUNTS": {
281
+ "TYPE": "GET",
282
+ "URI": "api/1/messages/count",
283
+ "AUTH": true
284
+ },
285
+ "MESSAGE_CENTER_MESSAGE_ACTION_UPDATE": {
286
+ "TYPE": "POST",
287
+ "URI": "api/1/messages/{message_id}/actions",
288
+ "AUTH": true
289
+ },
290
+ "MESSAGE_CENTER_CTA_PAGE": {
291
+ "TYPE": "GET",
292
+ "URI": "messages_cta_page",
293
+ "AUTH": true,
294
+ "CONTENT": "HTML"
295
+ },
296
+ "AUTH_COMMAND_TOKEN": {
297
+ "TYPE": "POST",
298
+ "URI": "api/1/users/command_token",
299
+ "AUTH": true
300
+ },
301
+ "SEND_DEVICE_KEY": {
302
+ "TYPE": "POST",
303
+ "URI": "api/1/users/keys",
304
+ "AUTH": true
305
+ },
306
+ "DIAGNOSTICS_ENTITLEMENTS": {
307
+ "TYPE": "GET",
308
+ "URI": "api/1/diagnostics",
309
+ "AUTH": true
310
+ },
311
+ "SEND_DIAGNOSTICS": {
312
+ "TYPE": "POST",
313
+ "URI": "api/1/diagnostics",
314
+ "AUTH": true
315
+ },
316
+ "BATTERY_SUMMARY": {
317
+ "TYPE": "GET",
318
+ "URI": "api/1/powerwalls/{battery_id}/status",
319
+ "AUTH": true
320
+ },
321
+ "BATTERY_DATA": {
322
+ "TYPE": "GET",
323
+ "URI": "api/1/powerwalls/{battery_id}",
324
+ "AUTH": true
325
+ },
326
+ "BATTERY_POWER_TIMESERIES_DATA": {
327
+ "TYPE": "GET",
328
+ "URI": "api/1/powerwalls/{battery_id}/powerhistory",
329
+ "AUTH": true
330
+ },
331
+ "BATTERY_ENERGY_TIMESERIES_DATA": {
332
+ "TYPE": "GET",
333
+ "URI": "api/1/powerwalls/{battery_id}/energyhistory",
334
+ "AUTH": true
335
+ },
336
+ "BATTERY_BACKUP_RESERVE": {
337
+ "TYPE": "POST",
338
+ "URI": "api/1/powerwalls/{battery_id}/backup",
339
+ "AUTH": true
340
+ },
341
+ "BATTERY_SITE_NAME": {
342
+ "TYPE": "POST",
343
+ "URI": "api/1/powerwalls/{battery_id}/site_name",
344
+ "AUTH": true
345
+ },
346
+ "BATTERY_OPERATION_MODE": {
347
+ "TYPE": "POST",
348
+ "URI": "api/1/powerwalls/{battery_id}/operation",
349
+ "AUTH": true
350
+ },
351
+ "SITE_SUMMARY": {
352
+ "TYPE": "GET",
353
+ "URI": "api/1/energy_sites/{site_id}/status",
354
+ "AUTH": true
355
+ },
356
+ "SITE_DATA": {
357
+ "TYPE": "GET",
358
+ "URI": "api/1/energy_sites/{site_id}/live_status",
359
+ "AUTH": true
360
+ },
361
+ "SITE_CONFIG": {
362
+ "TYPE": "GET",
363
+ "URI": "api/1/energy_sites/{site_id}/site_info",
364
+ "AUTH": true
365
+ },
366
+ "HISTORY_DATA": {
367
+ "TYPE": "GET",
368
+ "URI": "api/1/energy_sites/{site_id}/history",
369
+ "AUTH": true
370
+ },
371
+ "BACKUP_RESERVE": {
372
+ "TYPE": "POST",
373
+ "URI": "api/1/energy_sites/{site_id}/backup",
374
+ "AUTH": true
375
+ },
376
+ "SITE_NAME": {
377
+ "TYPE": "POST",
378
+ "URI": "api/1/energy_sites/{site_id}/site_name",
379
+ "AUTH": true
380
+ },
381
+ "OPERATION_MODE": {
382
+ "TYPE": "POST",
383
+ "URI": "api/1/energy_sites/{site_id}/operation",
384
+ "AUTH": true
385
+ },
386
+ "TIME_OF_USE_SETTINGS": {
387
+ "TYPE": "POST",
388
+ "URI": "api/1/energy_sites/{site_id}/time_of_use_settings",
389
+ "AUTH": true
390
+ },
391
+ "STORM_MODE_SETTINGS": {
392
+ "TYPE": "POST",
393
+ "URI": "api/1/energy_sites/{site_id}/storm_mode",
394
+ "AUTH": true
395
+ },
396
+ "SEND_NOTIFICATION_CONFIRMATION": {
397
+ "TYPE": "POST",
398
+ "URI": "api/1/notification_confirmations",
399
+ "AUTH": true
400
+ },
401
+ "NAVIGATION_REQUEST": {
402
+ "TYPE": "POST",
403
+ "URI": "api/1/vehicles/{vehicle_id}/command/navigation_request",
404
+ "AUTH": true
405
+ }
406
+ }
407
+ ```