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
@@ -1,130 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://owner-api.teslamotors.com/oauth/token
6
- body:
7
- encoding: UTF-8
8
- string: grant_type=password&client_id=<TESLA_CLIENT_ID>&client_secret=<TESLA_CLIENT_SECRET>&email=<TESLA_EMAIL>&password=<TESLA_PASS>
9
- headers:
10
- Accept-Encoding:
11
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
- Accept:
13
- - "*/*"
14
- User-Agent:
15
- - Ruby
16
- response:
17
- status:
18
- code: 200
19
- message: OK
20
- headers:
21
- Server:
22
- - nginx
23
- Date:
24
- - Wed, 17 Dec 2014 01:41:07 GMT
25
- Content-Type:
26
- - application/json; charset=utf-8
27
- Transfer-Encoding:
28
- - chunked
29
- Connection:
30
- - keep-alive
31
- Status:
32
- - 200 OK
33
- Cache-Control:
34
- - no-store
35
- Pragma:
36
- - no-cache
37
- X-Ua-Compatible:
38
- - IE=Edge,chrome=1
39
- X-Request-Id:
40
- - 6d7e5756f9e1dca92ee1f1453c66baca
41
- X-Runtime:
42
- - '0.454604'
43
- body:
44
- encoding: UTF-8
45
- string: '{"access_token":"c57d73eaa356ead451c12fc4757c79c1c7d16ac6dd6701202806d20d87f372ee","token_type":"bearer","expires_in":7776000}'
46
- http_version:
47
- recorded_at: Wed, 17 Dec 2014 01:41:09 GMT
48
- - request:
49
- method: get
50
- uri: https://owner-api.teslamotors.com/api/1/vehicles
51
- body:
52
- encoding: US-ASCII
53
- string: ''
54
- headers:
55
- Authorization:
56
- - Bearer c57d73eaa356ead451c12fc4757c79c1c7d16ac6dd6701202806d20d87f372ee
57
- response:
58
- status:
59
- code: 200
60
- message: OK
61
- headers:
62
- Server:
63
- - nginx
64
- Date:
65
- - Wed, 17 Dec 2014 01:41:08 GMT
66
- Content-Type:
67
- - application/json; charset=utf-8
68
- Content-Length:
69
- - '446'
70
- Connection:
71
- - keep-alive
72
- Status:
73
- - 200 OK
74
- X-Ua-Compatible:
75
- - IE=Edge,chrome=1
76
- Etag:
77
- - '"c52908b8db9336f89e7a1602f3b2a458"'
78
- Cache-Control:
79
- - max-age=0, private, must-revalidate
80
- X-Request-Id:
81
- - 23a39256e4a2d46d52bc3d198f9c15d3
82
- X-Runtime:
83
- - '0.208992'
84
- body:
85
- encoding: UTF-8
86
- string: '{"response":[{"color":null,"display_name":"Nikola","id":1514029006966957156,"option_codes":"MS01,RENA,TM00,DRLH,PF00,BT85,PBCW,RFPO,WT19,IBMB,IDPB,TR00,SU01,SC01,TP01,AU01,CH00,HP00,PA00,PS00,AD02,X020,X025,X001,X003,X007,X011,X013,COUS","vehicle_id":490215852,"vin":"5YJSA1CN5CFP01657","tokens":["b1278e37b13e8df2","b2fd1ad42f706a73"],"state":"online","remote_start_enabled":true,"calendar_enabled":true,"notifications_enabled":true}],"count":1}'
87
- http_version:
88
- recorded_at: Wed, 17 Dec 2014 01:41:10 GMT
89
- - request:
90
- method: post
91
- uri: https://owner-api.teslamotors.com/api/1/vehicles/1514029006966957156/command/sun_roof_control
92
- body:
93
- encoding: UTF-8
94
- string: state=move&percent=50
95
- headers:
96
- Authorization:
97
- - Bearer c57d73eaa356ead451c12fc4757c79c1c7d16ac6dd6701202806d20d87f372ee
98
- response:
99
- status:
100
- code: 200
101
- message: OK
102
- headers:
103
- Server:
104
- - nginx
105
- Date:
106
- - Wed, 17 Dec 2014 01:41:09 GMT
107
- Content-Type:
108
- - application/json; charset=utf-8
109
- Content-Length:
110
- - '40'
111
- Connection:
112
- - keep-alive
113
- Status:
114
- - 200 OK
115
- X-Ua-Compatible:
116
- - IE=Edge,chrome=1
117
- Etag:
118
- - '"f67eec105dd6522783a1f1bacc52723a"'
119
- Cache-Control:
120
- - max-age=0, private, must-revalidate
121
- X-Request-Id:
122
- - 74eb4c1c531006b451dc9d3fb96b3e67
123
- X-Runtime:
124
- - '0.214940'
125
- body:
126
- encoding: UTF-8
127
- string: '{"response":{"reason":"","result":true}}'
128
- http_version:
129
- recorded_at: Wed, 17 Dec 2014 01:41:10 GMT
130
- recorded_with: VCR 2.9.3