ex_tesla v2.0.2 ExTesla.Api

API for Tesla

Link to this section Summary

Functions

Check token is still valid and renew if required.

Get the charge state for a vehicle.

Get the climate state for a vehicle.

Get the drive state for a vehicle.

Get a token required for Tesla's API.

Get all data for a vehicle.

Get the vehicle state for a vehicle.

Get a list of all vehicles belonging to this account.

Renew a token required for Tesla's API.

Link to this section Functions

Link to this function

charge_start(token, vehicle)

charge_start(ExTesla.Api.Token.t(), map()) :: :ok | {:error, String.t()}

Start charging

Link to this function

charge_stop(token, vehicle)

charge_stop(ExTesla.Api.Token.t(), map()) :: :ok | {:error, String.t()}

Start charging

Link to this function

check_token(token)

check_token(ExTesla.Api.Token.t()) ::
  {:ok, ExTesla.Api.Token.t()} | {:error, String.t()}

Check token is still valid and renew if required.

Link to this function

get_charge_state(token, vehicle)

get_charge_state(ExTesla.Api.Token.t(), map()) ::
  {:ok, map()} | {:error, String.t()}

Get the charge state for a vehicle.

Link to this function

get_climate_state(token, vehicle)

get_climate_state(ExTesla.Api.Token.t(), map()) ::
  {:ok, map()} | {:error, String.t()}

Get the climate state for a vehicle.

Link to this function

get_drive_state(token, vehicle)

get_drive_state(ExTesla.Api.Token.t(), map()) ::
  {:ok, map()} | {:error, String.t()}

Get the drive state for a vehicle.

Link to this function

get_token(email, password)

get_token(String.t(), String.t()) ::
  {:ok, ExTesla.Api.Token.t()} | {:error, String.t()}

Get a token required for Tesla's API.

Link to this function

get_vehicle_data(token, vehicle)

get_vehicle_data(ExTesla.Api.Token.t(), map()) ::
  {:ok, map()} | {:error, String.t()}

Get all data for a vehicle.

Link to this function

get_vehicle_state(token, vehicle)

get_vehicle_state(ExTesla.Api.Token.t(), map()) ::
  {:ok, map()} | {:error, String.t()}

Get the vehicle state for a vehicle.

Link to this function

list_all_vehicles(token)

list_all_vehicles(ExTesla.Api.Token.t()) :: {:ok, map()} | {:error, String.t()}

Get a list of all vehicles belonging to this account.

Link to this function

parse_command_response(response)

parse_command_response({:ok, map()} | {:error, String.t()}) ::
  :ok | {:error, String.t()}
Link to this function

parse_response(response)

parse_response({:ok, map()} | {:error, String.t()}) ::
  {:ok, map()} | {:error, String.t()}
Link to this function

renew_token(token)

renew_token(ExTesla.Api.Token.t()) ::
  {:ok, ExTesla.Api.Token.t()} | {:error, String.t()}

Renew a token required for Tesla's API.

Link to this function

set_charge_limit(token, vehicle, percent)

set_charge_limit(ExTesla.Api.Token.t(), map(), integer()) ::
  :ok | {:error, String.t()}

Set charge limit

Link to this function

wake_up(token, vehicle)

wake_up(ExTesla.Api.Token.t(), map()) :: :ok | {:error, String.t()}

Wake up