Skip to content

Commit

Permalink
README: Update the example using up-to-date API (#752)
Browse files Browse the repository at this point in the history
  • Loading branch information
neomilium authored Sep 2, 2023
1 parent 48ad5cd commit e5abf06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ tesla_api = TeslaApi::Client.new(access_token: access_token)
model_s = tesla_api.vehicles.first # => <TeslaApi::Vehicle>

model_s.wake_up
model_s.auto_conditioning_start unless model_s.climate_state["is_auto_conditioning_on"]
vehicle_data = model_s.vehicle_data
model_s.auto_conditioning_start unless vehicle_data["climate_state"]["is_auto_conditioning_on"]

model_s.set_charge_limit(90)
model_s.charge_start

charge_state = model_s.charge_state
charge_state = vehicle_data["charge_state"]
puts "Your Model S is #{charge_state["charging_state"]} " +
"with a SOC of #{charge_state["battery_level"]}% " +
"and an estimate range of #{charge_state["est_battery_range"]} miles"
Expand Down

0 comments on commit e5abf06

Please sign in to comment.