Skip to content

Commit

Permalink
Adds tests for Speed Limit API features
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonah Hirsch committed Jul 18, 2018
1 parent 4420391 commit 2c1afc9
Show file tree
Hide file tree
Showing 6 changed files with 408 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/tesla_api/vehicle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,19 @@ def open_frunk
end

def activate_speed_limit(pin)
command("speed_limit_activate", body: {pin: pin})
command("speed_limit_activate", body: {pin: pin})["response"]
end

def deactivate_speed_limit(pin)
command("speed_limit_deactivate", body: {pin: pin})
command("speed_limit_deactivate", body: {pin: pin})["response"]
end

def set_speed_limit(limit_mph)
command("speed_limit_set_limit", body: {limit_mph: limit_mph})
command("speed_limit_set_limit", body: {limit_mph: limit_mph})["response"]
end

def clear_speed_limit_pin(pin)
command("speed_limit_clear_pin", body: {pin: pin})
command("speed_limit_clear_pin", body: {pin: pin})["response"]
end

private
Expand Down
95 changes: 95 additions & 0 deletions spec/cassettes/vehicle-activate_speed_limit.yml

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

95 changes: 95 additions & 0 deletions spec/cassettes/vehicle-clear_speed_limit_pin.yml

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

95 changes: 95 additions & 0 deletions spec/cassettes/vehicle-deactivate_speed_limit.yml

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

Loading

0 comments on commit 2c1afc9

Please sign in to comment.