tesla

package
v0.0.0-...-4b6ff7e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ProxyBaseUrl = "https://tesla.evcc.io"

Variables

View Source
var OAuth2Config = &oauth2.Config{
	RedirectURL: "https://auth.tesla.com/void/callback",
	Endpoint: oauth2.Endpoint{
		AuthURL:   "https://auth.tesla.com/en_us/oauth2/v3/authorize",
		TokenURL:  "https://auth.tesla.com/oauth2/v3/token",
		AuthStyle: oauth2.AuthStyleInParams,
	},
	Scopes: []string{"openid", "email", "offline_access"},
}

OAuth2Config is the OAuth2 configuration for authenticating with the Tesla API.

View Source
var TESLA_CLIENT_ID, TESLA_CLIENT_SECRET string

Functions

func NewIdentity

func NewIdentity(log *util.Logger, token *oauth2.Token) (oauth2.TokenSource, error)

Types

type CommandResponse

type CommandResponse = tesla.CommandResponse

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(ro, rw *tesla.Vehicle) *Controller

NewController creates a vehicle current and charge controller

func (*Controller) ChargeEnable

func (v *Controller) ChargeEnable(enable bool) error

ChargeEnable implements the api.ChargeController interface

func (*Controller) GetMaxCurrent

func (v *Controller) GetMaxCurrent() (float64, error)

StartCharge implements the api.VehicleChargeController interface

func (*Controller) MaxCurrent

func (v *Controller) MaxCurrent(current int64) error

MaxCurrent implements the api.CurrentController interface

type Identity

type Identity struct {
	oauth2.TokenSource
	// contains filtered or unexported fields
}

func (*Identity) RefreshToken

func (v *Identity) RefreshToken(token *oauth2.Token) (*oauth2.Token, error)

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(vehicle *tesla.Vehicle, cache time.Duration) *Provider

func (*Provider) ChargedEnergy

func (v *Provider) ChargedEnergy() (float64, error)

ChargedEnergy implements the api.ChargeRater interface

func (*Provider) FinishTime

func (v *Provider) FinishTime() (time.Time, error)

FinishTime implements the api.VehicleFinishTimer interface

func (*Provider) GetLimitSoc

func (v *Provider) GetLimitSoc() (int64, error)

GetLimitSoc implements the api.SocLimiter interface

func (*Provider) Odometer

func (v *Provider) Odometer() (float64, error)

Odometer implements the api.VehicleOdometer interface

func (*Provider) Range

func (v *Provider) Range() (int64, error)

Range implements the api.VehicleRange interface

func (*Provider) Soc

func (v *Provider) Soc() (float64, error)

Soc implements the api.Vehicle interface

func (*Provider) Status

func (v *Provider) Status() (api.ChargeStatus, error)

Status implements the api.ChargeState interface

func (*Provider) WakeUp

func (v *Provider) WakeUp() error

WakeUp implements the api.Resurrector interface

type Region

type Region struct {
	Region          string
	FleetApiBaseUrl string `json:"fleet_api_base_url"`
}

type RegionResponse

type RegionResponse struct {
	Response Region
}

type Vehicle

type Vehicle = tesla.Vehicle

type VehicleData

type VehicleData = tesla.VehicleData

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL