Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sentry Mode command #123

Merged
merged 2 commits into from
Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/vehicle/state/climatestate.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Information on the current internal temperature and climate control system.
"response": {
"battery_heater": false,
"battery_heater_no_power": false,
"climate_keeper_mode": "dog",
"driver_temp_setting": 21.6,
"fan_status": 0,
"inside_temp": null,
Expand Down
20 changes: 13 additions & 7 deletions docs/vehicle/state/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A rollup of all the `data_request` endpoints plus vehicle configuration.
"in_service": false,
"id_s": "12345678901234567",
"calendar_enabled": true,
"api_version": 4,
"api_version": 6,
"backseat_token": null,
"backseat_token_updated_at": null,
"drive_state": {
Expand All @@ -41,6 +41,7 @@ A rollup of all the `data_request` endpoints plus vehicle configuration.
"climate_state": {
"battery_heater": false,
"battery_heater_no_power": false,
"climate_keeper_mode": "dog",
"driver_temp_setting": 21.6,
"fan_status": 0,
"inside_temp": null,
Expand All @@ -54,14 +55,15 @@ A rollup of all the `data_request` endpoints plus vehicle configuration.
"min_avail_temp": 15.0,
"outside_temp": null,
"passenger_temp_setting": 21.6,
"remote_heater_control_enabled": true,
"right_temp_direction": null,
"seat_heater_left": false,
"seat_heater_rear_center": false,
"seat_heater_rear_left": false,
"seat_heater_left": 3,
"seat_heater_rear_center": 0,
"seat_heater_rear_left": 1,
"seat_heater_rear_left_back": 0,
"seat_heater_rear_right": false,
"seat_heater_rear_right": 1,
"seat_heater_rear_right_back": 0,
"seat_heater_right": false,
"seat_heater_right": 2,
"side_mirror_heaters": false,
"smart_preconditioning": false,
"steering_wheel_heater": false,
Expand All @@ -82,6 +84,7 @@ A rollup of all the `data_request` endpoints plus vehicle configuration.
"charge_limit_soc_std": 90,
"charge_miles_added_ideal": 50.0,
"charge_miles_added_rated": 40.0,
"charge_port_cold_weather_mode": false,
"charge_port_door_open": false,
"charge_port_latch": "Engaged",
"charge_rate": 0.0,
Expand Down Expand Up @@ -120,7 +123,7 @@ A rollup of all the `data_request` endpoints plus vehicle configuration.
"timestamp": 1543186971728
},
"vehicle_state": {
"api_version": 4,
"api_version": 6,
"autopark_state_v2": "standby",
"autopark_style": "standard",
"calendar_supported": true,
Expand All @@ -140,8 +143,10 @@ A rollup of all the `data_request` endpoints plus vehicle configuration.
"pf": 0,
"pr": 0,
"remote_start": false,
"remote_start_enabled": true,
"remote_start_supported": true,
"rt": 0,
"sentry_mode": true,
"software_update": { "expected_duration_sec": 2700, "status": "" },
"speed_limit_mode": {
"active": false,
Expand All @@ -167,6 +172,7 @@ A rollup of all the `data_request` endpoints plus vehicle configuration.
"exterior_color": "White",
"has_air_suspension": true,
"has_ludicrous_mode": false,
"key_version": 1,
"motorized_charge_port": true,
"perf_config": "P2",
"plg": true,
Expand Down
1 change: 1 addition & 0 deletions docs/vehicle/state/vehicleconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Returns the vehicle's configuration information including model, color, badging
"exterior_color": "White",
"has_air_suspension": true,
"has_ludicrous_mode": false,
"key_version": 1,
"motorized_charge_port": true,
"perf_config": "P2",
"plg": true,
Expand Down
4 changes: 3 additions & 1 deletion docs/vehicle/state/vehiclestate.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Returns the vehicle's physical state, such as which doors are open.
```json
{
"response": {
"api_version": 4,
"api_version": 6,
"autopark_state_v2": "ready",
"autopark_style": "standard",
"calendar_supported": true,
Expand All @@ -29,8 +29,10 @@ Returns the vehicle's physical state, such as which doors are open.
"pf": 0,
"pr": 0,
"remote_start": false,
"remote_start_enabled": true,
"remote_start_supported": true,
"rt": 0,
"sentry_mode": true,
"software_update": { "expected_duration_sec": 2700, "status": "" },
"speed_limit_mode": {
"active": false,
Expand Down
4 changes: 4 additions & 0 deletions lib/tesla_api/vehicle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ def set_steering_wheel_heater(on)
command('remote_steering_wheel_heater_request', body: {on: on})['response']
end

def set_sentry_mode(on)
command('set_sentry_mode', body: {on: on})['response']
end

private

def data_request(name)
Expand Down
100 changes: 100 additions & 0 deletions spec/cassettes/vehicle-set_sentry_mode.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions spec/lib/tesla_api/vehicle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,10 @@
expect(vehicle.set_steering_wheel_heater(false)['result']).to eq(true)
end
end

describe '#set_sentry_mode', vcr: {cassette_name: 'vehicle-set_sentry_mode'} do
it 'disables sentry mode' do
expect(vehicle.set_sentry_mode(false)['result']).to eq(true)
end
end
end