tesla_api 3.0.3 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +36 -0
- data/.tool-versions +1 -1
- data/docs/README.md +1 -1
- data/docs/api-basics/authentication.md +163 -36
- data/docs/api-basics/vehicles.md +5 -6
- data/docs/miscellaneous/endpoints.md +26 -4
- data/docs/vehicle/commands/climate.md +2 -0
- data/docs/vehicle/commands/homelink.md +1 -1
- data/docs/vehicle/commands/sharing.md +2 -2
- data/docs/vehicle/commands/valet.md +7 -5
- data/docs/vehicle/commands/wake.md +4 -1
- data/docs/vehicle/commands/windows.md +6 -2
- data/docs/vehicle/optioncodes.md +134 -61
- data/docs/vehicle/state/chargestate.md +17 -16
- data/docs/vehicle/state/climatestate.md +13 -19
- data/docs/vehicle/state/data.md +73 -61
- data/docs/vehicle/state/guisettings.md +1 -0
- data/docs/vehicle/state/nearbychargingsites.md +49 -74
- data/docs/vehicle/state/vehicleconfig.md +3 -3
- data/docs/vehicle/state/vehiclestate.md +43 -19
- data/lib/tesla_api/autopark.rb +6 -6
- data/lib/tesla_api/client.rb +88 -16
- data/lib/tesla_api/stream.rb +13 -13
- data/lib/tesla_api/vehicle.rb +5 -1
- data/lib/tesla_api/version.rb +1 -1
- data/spec/cassettes/client-login.yml +254 -46
- data/spec/cassettes/client-refresh.yml +109 -49
- data/spec/cassettes/vehicle-vehicle_data.yml +115 -0
- data/spec/lib/tesla_api/client_spec.rb +20 -8
- data/spec/lib/tesla_api/vehicle_spec.rb +12 -0
- data/tesla_api.gemspec +2 -2
- metadata +13 -11
- data/.travis.yml +0 -16
@@ -11,33 +11,27 @@ Information on the current internal temperature and climate control system.
|
|
11
11
|
"response": {
|
12
12
|
"battery_heater": false,
|
13
13
|
"battery_heater_no_power": false,
|
14
|
-
"climate_keeper_mode": "
|
15
|
-
"
|
14
|
+
"climate_keeper_mode": "off",
|
15
|
+
"defrost_mode": 0,
|
16
|
+
"driver_temp_setting": 22.8,
|
16
17
|
"fan_status": 0,
|
17
|
-
"inside_temp":
|
18
|
-
"is_auto_conditioning_on":
|
18
|
+
"inside_temp": 27.0,
|
19
|
+
"is_auto_conditioning_on": false,
|
19
20
|
"is_climate_on": false,
|
20
21
|
"is_front_defroster_on": false,
|
21
22
|
"is_preconditioning": false,
|
22
23
|
"is_rear_defroster_on": false,
|
23
|
-
"left_temp_direction":
|
24
|
+
"left_temp_direction": -232,
|
24
25
|
"max_avail_temp": 28.0,
|
25
26
|
"min_avail_temp": 15.0,
|
26
|
-
"outside_temp":
|
27
|
-
"passenger_temp_setting":
|
28
|
-
"remote_heater_control_enabled":
|
29
|
-
"right_temp_direction":
|
30
|
-
"seat_heater_left":
|
31
|
-
"
|
32
|
-
"seat_heater_rear_left": 1,
|
33
|
-
"seat_heater_rear_left_back": 0,
|
34
|
-
"seat_heater_rear_right": 1,
|
35
|
-
"seat_heater_rear_right_back": 0,
|
36
|
-
"seat_heater_right": 2,
|
27
|
+
"outside_temp": 23.0,
|
28
|
+
"passenger_temp_setting": 22.8,
|
29
|
+
"remote_heater_control_enabled": false,
|
30
|
+
"right_temp_direction": -232,
|
31
|
+
"seat_heater_left": 0,
|
32
|
+
"seat_heater_right": 0,
|
37
33
|
"side_mirror_heaters": false,
|
38
|
-
"
|
39
|
-
"steering_wheel_heater": false,
|
40
|
-
"timestamp": 1543187641727,
|
34
|
+
"timestamp": 1604977244530,
|
41
35
|
"wiper_blade_heater": false
|
42
36
|
}
|
43
37
|
}
|
data/docs/vehicle/state/data.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
A rollup of all the `data_request` endpoints plus vehicle configuration.
|
6
6
|
|
7
|
-
|
7
|
+
_Note:_ all `*_range` values are in miles, irrespective of GUI configuration.
|
8
8
|
|
9
9
|
### Response
|
10
10
|
|
@@ -16,18 +16,19 @@ A rollup of all the `data_request` endpoints plus vehicle configuration.
|
|
16
16
|
"vehicle_id": 1234567890,
|
17
17
|
"vin": "5YJSA11111111111",
|
18
18
|
"display_name": "Nikola 2.0",
|
19
|
-
"option_codes": "
|
19
|
+
"option_codes": "AD15,MDL3,PBSB,RENA,BT37,ID3W,RF3G,S3PB,DRLH,DV2W,W39B,APF0,COUS,BC3B,CH07,PC30,FC3P,FG31,GLFR,HL31,HM31,IL31,LTPB,MR31,FM3B,RS3H,SA3P,STCP,SC04,SU3C,T3CA,TW00,TM00,UT3P,WR00,AU3P,APH3,AF00,ZCST,MI00,CDM0",
|
20
20
|
"color": null,
|
21
|
+
"access_type": "OWNER",
|
21
22
|
"tokens": ["abcdef1234567890", "1234567890abcdef"],
|
22
23
|
"state": "online",
|
23
24
|
"in_service": false,
|
24
25
|
"id_s": "12345678901234567",
|
25
26
|
"calendar_enabled": true,
|
26
|
-
"api_version":
|
27
|
+
"api_version": 13,
|
27
28
|
"backseat_token": null,
|
28
29
|
"backseat_token_updated_at": null,
|
29
30
|
"drive_state": {
|
30
|
-
"gps_as_of":
|
31
|
+
"gps_as_of": 1607623884,
|
31
32
|
"heading": 5,
|
32
33
|
"latitude": 33.111111,
|
33
34
|
"longitude": -88.111111,
|
@@ -35,85 +36,80 @@ A rollup of all the `data_request` endpoints plus vehicle configuration.
|
|
35
36
|
"native_location_supported": 1,
|
36
37
|
"native_longitude": -88.111111,
|
37
38
|
"native_type": "wgs",
|
38
|
-
"power":
|
39
|
+
"power": -9,
|
39
40
|
"shift_state": null,
|
40
41
|
"speed": null,
|
41
|
-
"timestamp":
|
42
|
+
"timestamp": 1607623897515
|
42
43
|
},
|
43
44
|
"climate_state": {
|
44
45
|
"battery_heater": false,
|
45
46
|
"battery_heater_no_power": false,
|
46
|
-
"climate_keeper_mode": "
|
47
|
-
"
|
47
|
+
"climate_keeper_mode": "off",
|
48
|
+
"defrost_mode": 0,
|
49
|
+
"driver_temp_setting": 21.1,
|
48
50
|
"fan_status": 0,
|
49
|
-
"inside_temp":
|
50
|
-
"is_auto_conditioning_on":
|
51
|
+
"inside_temp": 22.1,
|
52
|
+
"is_auto_conditioning_on": false,
|
51
53
|
"is_climate_on": false,
|
52
54
|
"is_front_defroster_on": false,
|
53
55
|
"is_preconditioning": false,
|
54
56
|
"is_rear_defroster_on": false,
|
55
|
-
"left_temp_direction":
|
57
|
+
"left_temp_direction": -66,
|
56
58
|
"max_avail_temp": 28.0,
|
57
59
|
"min_avail_temp": 15.0,
|
58
|
-
"outside_temp":
|
59
|
-
"passenger_temp_setting": 21.
|
60
|
-
"remote_heater_control_enabled":
|
61
|
-
"right_temp_direction":
|
62
|
-
"seat_heater_left":
|
63
|
-
"
|
64
|
-
"seat_heater_rear_left": 1,
|
65
|
-
"seat_heater_rear_left_back": 0,
|
66
|
-
"seat_heater_rear_right": 1,
|
67
|
-
"seat_heater_rear_right_back": 0,
|
68
|
-
"seat_heater_right": 2,
|
60
|
+
"outside_temp": 18.0,
|
61
|
+
"passenger_temp_setting": 21.1,
|
62
|
+
"remote_heater_control_enabled": false,
|
63
|
+
"right_temp_direction": -66,
|
64
|
+
"seat_heater_left": 0,
|
65
|
+
"seat_heater_right": 0,
|
69
66
|
"side_mirror_heaters": false,
|
70
|
-
"
|
71
|
-
"steering_wheel_heater": false,
|
72
|
-
"timestamp": 1543186971731,
|
67
|
+
"timestamp": 1607623897515,
|
73
68
|
"wiper_blade_heater": false
|
74
69
|
},
|
75
70
|
"charge_state": {
|
76
71
|
"battery_heater_on": false,
|
77
|
-
"battery_level":
|
78
|
-
"battery_range":
|
79
|
-
"charge_current_request":
|
80
|
-
"charge_current_request_max":
|
72
|
+
"battery_level": 59,
|
73
|
+
"battery_range": 149.92,
|
74
|
+
"charge_current_request": 40,
|
75
|
+
"charge_current_request_max": 40,
|
81
76
|
"charge_enable_request": true,
|
82
|
-
"charge_energy_added":
|
77
|
+
"charge_energy_added": 2.42,
|
83
78
|
"charge_limit_soc": 90,
|
84
79
|
"charge_limit_soc_max": 100,
|
85
80
|
"charge_limit_soc_min": 50,
|
86
81
|
"charge_limit_soc_std": 90,
|
87
|
-
"charge_miles_added_ideal":
|
88
|
-
"charge_miles_added_rated":
|
89
|
-
"charge_port_cold_weather_mode":
|
90
|
-
"charge_port_door_open":
|
82
|
+
"charge_miles_added_ideal": 10.0,
|
83
|
+
"charge_miles_added_rated": 8.0,
|
84
|
+
"charge_port_cold_weather_mode": null,
|
85
|
+
"charge_port_door_open": true,
|
91
86
|
"charge_port_latch": "Engaged",
|
92
|
-
"charge_rate":
|
87
|
+
"charge_rate": 28.0,
|
93
88
|
"charge_to_max_range": false,
|
94
|
-
"charger_actual_current":
|
95
|
-
"charger_phases":
|
96
|
-
"charger_pilot_current":
|
97
|
-
"charger_power":
|
98
|
-
"charger_voltage":
|
99
|
-
"charging_state": "
|
100
|
-
"conn_charge_cable": "
|
101
|
-
"est_battery_range":
|
89
|
+
"charger_actual_current": 40,
|
90
|
+
"charger_phases": 1,
|
91
|
+
"charger_pilot_current": 40,
|
92
|
+
"charger_power": 9,
|
93
|
+
"charger_voltage": 243,
|
94
|
+
"charging_state": "Charging",
|
95
|
+
"conn_charge_cable": "SAE",
|
96
|
+
"est_battery_range": 132.98,
|
102
97
|
"fast_charger_brand": "<invalid>",
|
103
98
|
"fast_charger_present": false,
|
104
99
|
"fast_charger_type": "<invalid>",
|
105
|
-
"ideal_battery_range":
|
100
|
+
"ideal_battery_range": 187.4,
|
106
101
|
"managed_charging_active": false,
|
107
102
|
"managed_charging_start_time": null,
|
108
103
|
"managed_charging_user_canceled": false,
|
109
104
|
"max_range_charge_counter": 0,
|
105
|
+
"minutes_to_full_charge": 165,
|
110
106
|
"not_enough_power_to_heat": false,
|
111
107
|
"scheduled_charging_pending": false,
|
112
108
|
"scheduled_charging_start_time": null,
|
113
|
-
"time_to_full_charge":
|
114
|
-
"timestamp":
|
109
|
+
"time_to_full_charge": 2.75,
|
110
|
+
"timestamp": 1607623897515,
|
115
111
|
"trip_charging": false,
|
116
|
-
"usable_battery_level":
|
112
|
+
"usable_battery_level": 59,
|
117
113
|
"user_charge_enable_request": null
|
118
114
|
},
|
119
115
|
"gui_settings": {
|
@@ -122,47 +118,62 @@ A rollup of all the `data_request` endpoints plus vehicle configuration.
|
|
122
118
|
"gui_distance_units": "mi/hr",
|
123
119
|
"gui_range_display": "Rated",
|
124
120
|
"gui_temperature_units": "F",
|
125
|
-
"
|
121
|
+
"show_range_units": true,
|
122
|
+
"timestamp": 1607623897515
|
126
123
|
},
|
127
124
|
"vehicle_state": {
|
128
|
-
"api_version":
|
125
|
+
"api_version": 13,
|
129
126
|
"autopark_state_v2": "standby",
|
130
127
|
"autopark_style": "standard",
|
131
128
|
"calendar_supported": true,
|
132
|
-
"car_version": "
|
129
|
+
"car_version": "2020.48.10 f8900cddd03a",
|
133
130
|
"center_display_state": 0,
|
134
131
|
"df": 0,
|
135
132
|
"dr": 0,
|
133
|
+
"fd_window": 0,
|
134
|
+
"fp_window": 0,
|
136
135
|
"ft": 0,
|
136
|
+
"homelink_device_count": 2,
|
137
137
|
"homelink_nearby": true,
|
138
138
|
"is_user_present": false,
|
139
139
|
"last_autopark_error": "no_error",
|
140
|
-
"locked":
|
140
|
+
"locked": false,
|
141
141
|
"media_state": { "remote_control_enabled": true },
|
142
142
|
"notifications_supported": true,
|
143
|
-
"odometer":
|
143
|
+
"odometer": 57869.762487,
|
144
144
|
"parsed_calendar_supported": true,
|
145
145
|
"pf": 0,
|
146
146
|
"pr": 0,
|
147
|
+
"rd_window": 0,
|
147
148
|
"remote_start": false,
|
148
149
|
"remote_start_enabled": true,
|
149
150
|
"remote_start_supported": true,
|
151
|
+
"rp_window": 0,
|
150
152
|
"rt": 0,
|
151
|
-
"sentry_mode":
|
152
|
-
"
|
153
|
+
"sentry_mode": false,
|
154
|
+
"sentry_mode_available": true,
|
155
|
+
"smart_summon_available": true,
|
156
|
+
"software_update": {
|
157
|
+
"download_perc": 0,
|
158
|
+
"expected_duration_sec": 2700,
|
159
|
+
"install_perc": 1,
|
160
|
+
"status": "",
|
161
|
+
"version": ""
|
162
|
+
},
|
153
163
|
"speed_limit_mode": {
|
154
164
|
"active": false,
|
155
|
-
"current_limit_mph":
|
165
|
+
"current_limit_mph": 85.0,
|
156
166
|
"max_limit_mph": 90,
|
157
167
|
"min_limit_mph": 50,
|
158
168
|
"pin_code_set": false
|
159
169
|
},
|
170
|
+
"summon_standby_mode_enabled": false,
|
160
171
|
"sun_roof_percent_open": 0,
|
161
|
-
"sun_roof_state": "
|
162
|
-
"timestamp":
|
172
|
+
"sun_roof_state": "closed",
|
173
|
+
"timestamp": 1607623897515,
|
163
174
|
"valet_mode": false,
|
164
175
|
"valet_pin_needed": true,
|
165
|
-
"vehicle_name":
|
176
|
+
"vehicle_name": null
|
166
177
|
},
|
167
178
|
"vehicle_config": {
|
168
179
|
"can_accept_navigation_requests": true,
|
@@ -170,13 +181,13 @@ A rollup of all the `data_request` endpoints plus vehicle configuration.
|
|
170
181
|
"car_special_type": "base",
|
171
182
|
"car_type": "models2",
|
172
183
|
"charge_port_type": "US",
|
184
|
+
"default_charge_to_max": false,
|
185
|
+
"ece_restrictions": false,
|
173
186
|
"eu_vehicle": false,
|
174
187
|
"exterior_color": "White",
|
175
188
|
"has_air_suspension": true,
|
176
189
|
"has_ludicrous_mode": false,
|
177
|
-
"key_version": 1,
|
178
190
|
"motorized_charge_port": true,
|
179
|
-
"perf_config": "P2",
|
180
191
|
"plg": true,
|
181
192
|
"rear_seat_heaters": 0,
|
182
193
|
"rear_seat_type": 0,
|
@@ -186,8 +197,9 @@ A rollup of all the `data_request` endpoints plus vehicle configuration.
|
|
186
197
|
"spoiler_type": "None",
|
187
198
|
"sun_roof_installed": 2,
|
188
199
|
"third_row_seats": "None",
|
189
|
-
"timestamp":
|
200
|
+
"timestamp": 1607623897515,
|
190
201
|
"trim_badging": "p90d",
|
202
|
+
"use_range_badging": false,
|
191
203
|
"wheel_type": "AeroTurbine19"
|
192
204
|
}
|
193
205
|
}
|
@@ -8,98 +8,73 @@ Returns a list of nearby Tesla-operated charging stations. (Requires car softwar
|
|
8
8
|
|
9
9
|
```json
|
10
10
|
{
|
11
|
-
"response":{
|
12
|
-
"congestion_sync_time_utc_secs":
|
13
|
-
"destination_charging":[
|
11
|
+
"response": {
|
12
|
+
"congestion_sync_time_utc_secs": 1604976488,
|
13
|
+
"destination_charging": [
|
14
14
|
{
|
15
|
-
"location":{
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
"name":"Long Beach Marriott",
|
20
|
-
"type":"destination",
|
21
|
-
"distance_miles":2.201606
|
15
|
+
"location": { "lat": 34.010854, "long": -84.574979 },
|
16
|
+
"name": "Hilton Garden Inn Atlanta NW/Kennesaw Town Center",
|
17
|
+
"type": "destination",
|
18
|
+
"distance_miles": 6.430447
|
22
19
|
},
|
23
20
|
{
|
24
|
-
"location":{
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
"name":"Renaissance Long Beach Hotel",
|
29
|
-
"type":"destination",
|
30
|
-
"distance_miles":4.071068
|
21
|
+
"location": { "lat": 34.011213, "long": -84.575745 },
|
22
|
+
"name": "Homewood Suites by Hilton Atlanta NW-Kennesaw",
|
23
|
+
"type": "destination",
|
24
|
+
"distance_miles": 6.48008
|
31
25
|
},
|
32
26
|
{
|
33
|
-
"location":{
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
"name":"Hotel Maya, a Doubletree by Hilton",
|
38
|
-
"type":"destination",
|
39
|
-
"distance_miles":4.843953
|
27
|
+
"location": { "lat": 33.881785, "long": -84.473461 },
|
28
|
+
"name": "Hyatt Place Atlanta/Cobb Galleria",
|
29
|
+
"type": "destination",
|
30
|
+
"distance_miles": 6.778101
|
40
31
|
},
|
41
32
|
{
|
42
|
-
"location":{
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
"name":"The Gardens Casino",
|
47
|
-
"type":"destination",
|
48
|
-
"distance_miles":6.449794
|
33
|
+
"location": { "lat": 33.991767, "long": -84.351229 },
|
34
|
+
"name": "European Collision Repair",
|
35
|
+
"type": "destination",
|
36
|
+
"distance_miles": 6.805893
|
49
37
|
}
|
50
38
|
],
|
51
|
-
"superchargers":[
|
39
|
+
"superchargers": [
|
52
40
|
{
|
53
|
-
"location":{
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
"
|
58
|
-
"
|
59
|
-
"
|
60
|
-
"available_stalls":5,
|
61
|
-
"total_stalls":12,
|
62
|
-
"site_closed":false
|
41
|
+
"location": { "lat": 33.848756, "long": -84.36434 },
|
42
|
+
"name": "Atlanta, GA - Peachtree Road",
|
43
|
+
"type": "supercharger",
|
44
|
+
"distance_miles": 10.868304,
|
45
|
+
"available_stalls": 4,
|
46
|
+
"total_stalls": 5,
|
47
|
+
"site_closed": false
|
63
48
|
},
|
64
49
|
{
|
65
|
-
"location":{
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
"
|
70
|
-
"
|
71
|
-
"
|
72
|
-
"available_stalls":6,
|
73
|
-
"total_stalls":12,
|
74
|
-
"site_closed":false
|
50
|
+
"location": { "lat": 33.846487, "long": -84.360172 },
|
51
|
+
"name": "Atlanta, GA - Lenox Road",
|
52
|
+
"type": "supercharger",
|
53
|
+
"distance_miles": 11.131691,
|
54
|
+
"available_stalls": 16,
|
55
|
+
"total_stalls": 16,
|
56
|
+
"site_closed": false
|
75
57
|
},
|
76
58
|
{
|
77
|
-
"location":{
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
"
|
82
|
-
"
|
83
|
-
"
|
84
|
-
"available_stalls":3,
|
85
|
-
"total_stalls":6,
|
86
|
-
"site_closed":false
|
59
|
+
"location": { "lat": 34.075818, "long": -84.652184 },
|
60
|
+
"name": "Acworth, GA",
|
61
|
+
"type": "supercharger",
|
62
|
+
"distance_miles": 12.403464,
|
63
|
+
"available_stalls": 11,
|
64
|
+
"total_stalls": 11,
|
65
|
+
"site_closed": false
|
87
66
|
},
|
88
67
|
{
|
89
|
-
"location":{
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
"
|
94
|
-
"
|
95
|
-
"
|
96
|
-
"available_stalls":3,
|
97
|
-
"total_stalls":8,
|
98
|
-
"site_closed":false
|
68
|
+
"location": { "lat": 34.071365, "long": -84.275362 },
|
69
|
+
"name": "Alpharetta, GA",
|
70
|
+
"type": "supercharger",
|
71
|
+
"distance_miles": 12.772961,
|
72
|
+
"available_stalls": 6,
|
73
|
+
"total_stalls": 10,
|
74
|
+
"site_closed": false
|
99
75
|
}
|
100
76
|
],
|
101
|
-
"timestamp":
|
77
|
+
"timestamp": 1604977312943
|
102
78
|
}
|
103
79
|
}
|
104
80
|
```
|
105
|
-
|