/teslac

tesla api client

Primary LanguageJavaScript

teslac

read your tesla

Install

npm install teslac

Uage

// get your tokens from mobile app "Auth for Tesla"(ios) or "Tesla Tokens"(android)
teslac(access_token, refresh_token)
  .then((tc) =>
    tc
      .control(
        tc.vehicles[0].id,
        tc.ownerApi(`/vehicles/${tc.vehicles[0].id}/data_request/charge_state`)
      )
      .then(console.log)
  )
  .catch((err) => {
    console.log(err)
  })

Examples

API