Categorygithub.com/evcc-io/tesla-proxy-client
modulepackage
0.0.0-20240221194046-4168b3759701
Repository: https://github.com/evcc-io/tesla-proxy-client.git
Documentation: pkg.go.dev

# README

tesla

This library provides a wrapper around the API to easily query and command a Tesla remotely in Go.

Library Documentation

https://godoc.org/github.com/bogosj/tesla

API Documentation

View Tesla JSON API Documentation

This is unofficial documentation of the Tesla JSON API used by the iOS and Android apps. The API provides functionality to monitor and control Telsa vehicles remotely. The project provides both a documention of the API and a Go library for accessing it.

Installation

go get github.com/bogosj/tesla

Usage

Examples can be found in the /examples project directory.

OAuth Token

One way to acquire an OAuth token is to run cmd/login.


# cd cmd/login

# go run . -o ~/tesla.token
✔ Username: [email protected]
✔ Password: ***
Passcode: 463932

This will output a token to the tesla.token file in your home directory.

Differences from jsgoecke/tesla

Streaming API

The implementation of the Streaming API is not working. The code was removed in this commit. If you are interested in getting this working again feel free to send a PR reverting these changes and providing a fix.

Credits

Thank you to Tim Dorr who did the heavy lifting to document the Tesla API and also created the model-s-api Ruby Gem.

Thank you to jsgoecke from whom this project is forked.

Copyright & License

Copyright (c) 2016-2021 Jason Goecke.

Copyright (c) 2021-present James Bogosian.

Released under the terms of the MIT license. See LICENSE for details.

# Packages

No description provided by the author

# Functions

NewClient creates a new Tesla API client.
WithClient provides set the http.Client.
WithTokenSource provides an oauth2.TokenSource to the client for auth.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

AutoParkRequest are the required elements to POST an Autopark/Summon request for the vehicle.
ChargeState contains the current charge states that exist within the vehicle.
Client provides the client and associated elements for interacting with the Tesla API.
ClimateState contains the current climate states availale from the vehicle.
CommandResponse is the response from the Tesla API after POSTing a command.
DriveState contains the current drive state of the vehicle.
this represents site_info endpoint.
No description provided by the author
No description provided by the author
No description provided by the author
GuiSettings contains the current GUI settings of the vehicle.
No description provided by the author
No description provided by the author
MobileEnabledResponse is the response when a state is requested.
NearbyChargingSitesResponse represents the charging sites returned from the API.
No description provided by the author
ProductResponse contains the product details from the Tesla API.
No description provided by the author
No description provided by the author
SentryData shows whether Sentry is on.
ServiceData contains the service data of the vehicle.
SiteCommandResponse is the response from the Tesla API after POSTing a command.
No description provided by the author
No description provided by the author
No description provided by the author
Vehicle represents the vehicle as returned from the Tesla API.
VehicleConfig represents the configuration of a vehicle.
VehicleData represents the states of the vehicle.
VehiclePartialResponse represents the vehicle response root data as returned from the Tesla API.
VehicleResponse contains the vehicle details from the Tesla API.
VehiclesResponse contains a slice of Vehicles from the Tesla API.
VehicleState contains the current state of the vehicle.

# Type aliases

ClientOption can be passed when creating the client.
No description provided by the author
No description provided by the author