vehicle

package
v0.0.0-...-722e3e0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAudiFromConfig

func NewAudiFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewAudiFromConfig creates a new vehicle

func NewBMWFromConfig

func NewBMWFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewBMWFromConfig creates a new vehicle

func NewCarWingsFromConfig

func NewCarWingsFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewCarWingsFromConfig creates a new vehicle

func NewCitroenFromConfig

func NewCitroenFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewCitroenFromConfig creates a new vehicle

func NewCloudFromConfig

func NewCloudFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewCloudFromConfig creates a new vehicle

func NewConfigurableFromConfig

func NewConfigurableFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewConfigurableFromConfig creates a new Vehicle

func NewDSFromConfig

func NewDSFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewDSFromConfig creates a new vehicle

func NewEnyaqFromConfig

func NewEnyaqFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewEnyaqFromConfig creates a new vehicle

func NewFiatFromConfig

func NewFiatFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewFiatFromConfig creates a new vehicle

func NewFordFromConfig

func NewFordFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewFordFromConfig creates a new vehicle

func NewFromConfig

func NewFromConfig(typ string, other map[string]interface{}) (v api.Vehicle, err error)

NewFromConfig creates vehicle from configuration

func NewHyundaiFromConfig

func NewHyundaiFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewHyundaiFromConfig creates a new Vehicle

func NewIDFromConfig

func NewIDFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewIDFromConfig creates a new vehicle

func NewKiaFromConfig

func NewKiaFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewKiaFromConfig creates a new Vehicle

func NewNissanFromConfig

func NewNissanFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewNissanFromConfig creates a new vehicle

func NewNiuFromConfig

func NewNiuFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewFordFromConfig creates a new vehicle

func NewOpelFromConfig

func NewOpelFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewOpelFromConfig creates a new vehicle

func NewOvmsFromConfig

func NewOvmsFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewOVMSFromConfig creates a new vehicle

func NewPeugeotFromConfig

func NewPeugeotFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewPeugeotFromConfig creates a new vehicle

func NewPorscheFromConfig

func NewPorscheFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewPorscheFromConfig creates a new vehicle

func NewRenaultFromConfig

func NewRenaultFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewRenaultFromConfig creates a new vehicle

func NewSeatFromConfig

func NewSeatFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewSeatFromConfig creates a new vehicle

func NewSkodaFromConfig

func NewSkodaFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewSkodaFromConfig creates a new vehicle

func NewTeslaFromConfig

func NewTeslaFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewTeslaFromConfig creates a new vehicle

func NewTronityFromConfig

func NewTronityFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewTronityFromConfig creates a new vehicle

func NewVWFromConfig

func NewVWFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewVWFromConfig creates a new vehicle

func NewVolvoFromConfig

func NewVolvoFromConfig(other map[string]interface{}) (api.Vehicle, error)

NewVolvoFromConfig creates a new vehicle

func Types

func Types() []string

Types returns the list of vehicle types

Types

type Audi

type Audi struct {
	*vw.Provider // provides the api implementations
	// contains filtered or unexported fields
}

Audi is an api.Vehicle implementation for Audi cars

func (Audi) Capacity

func (v Audi) Capacity() int64

Capacity implements the api.Vehicle interface

func (Audi) Identify

func (v Audi) Identify() (string, error)

Identify implements the api.Identifier interface

func (Audi) Title

func (v Audi) Title() string

Title implements the api.Vehicle interface

type BMW

type BMW struct {
	*bmw.Provider // provides the api implementations
	// contains filtered or unexported fields
}

BMW is an api.Vehicle implementation for BMW and Mini cars

func (BMW) Capacity

func (v BMW) Capacity() int64

Capacity implements the api.Vehicle interface

func (BMW) Identify

func (v BMW) Identify() (string, error)

Identify implements the api.Identifier interface

func (BMW) Title

func (v BMW) Title() string

Title implements the api.Vehicle interface

type CarWings

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

CarWings is an api.Vehicle implementation for CarWings cars

func (CarWings) Capacity

func (v CarWings) Capacity() int64

Capacity implements the api.Vehicle interface

func (*CarWings) Climater

func (v *CarWings) Climater() (active bool, outsideTemp float64, targetTemp float64, err error)

Climater implements the api.VehicleClimater interface

func (CarWings) Identify

func (v CarWings) Identify() (string, error)

Identify implements the api.Identifier interface

func (*CarWings) Range

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

Range implements the api.VehicleRange interface

func (*CarWings) SoC

func (v *CarWings) SoC() (float64, error)

SoC implements the api.Vehicle interface

func (*CarWings) Status

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

Status implements the api.ChargeState interface

func (CarWings) Title

func (v CarWings) Title() string

Title implements the api.Vehicle interface

type ClientCredentials

type ClientCredentials struct {
	ID, Secret string
}

ClientCredentials contains OAuth2 client id and secret

func (*ClientCredentials) Error

func (c *ClientCredentials) Error() error

Error validates the credentials and returns an error if they are incomplete

type Cloud

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

Cloud is an api.Vehicle implementation

func (Cloud) Capacity

func (v Cloud) Capacity() int64

Capacity implements the api.Vehicle interface

func (Cloud) Identify

func (v Cloud) Identify() (string, error)

Identify implements the api.Identifier interface

func (*Cloud) SoC

func (v *Cloud) SoC() (float64, error)

SoC implements the api.Vehicle interface

func (Cloud) Title

func (v Cloud) Title() string

Title implements the api.Vehicle interface

type Enyaq

type Enyaq struct {
	*skoda.Provider // provides the api implementations
	// contains filtered or unexported fields
}

Enyaq is an api.Vehicle implementation for Skoda Enyaq cars

func (Enyaq) Capacity

func (v Enyaq) Capacity() int64

Capacity implements the api.Vehicle interface

func (Enyaq) Identify

func (v Enyaq) Identify() (string, error)

Identify implements the api.Identifier interface

func (Enyaq) Title

func (v Enyaq) Title() string

Title implements the api.Vehicle interface

type Fiat

type Fiat struct {
	*request.Helper
	// contains filtered or unexported fields
}

Fiat is an api.Vehicle implementation for Fiat cars

func (Fiat) Capacity

func (v Fiat) Capacity() int64

Capacity implements the api.Vehicle interface

func (Fiat) Identify

func (v Fiat) Identify() (string, error)

Identify implements the api.Identifier interface

func (*Fiat) Range

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

Range implements the api.VehicleRange interface

func (*Fiat) SoC

func (v *Fiat) SoC() (float64, error)

SoC implements the api.Vehicle interface

func (*Fiat) Status

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

Status implements the api.ChargeState interface

func (Fiat) Title

func (v Fiat) Title() string

Title implements the api.Vehicle interface

type Ford

type Ford struct {
	*request.Helper
	// contains filtered or unexported fields
}

Ford is an api.Vehicle implementation for Ford cars

func (Ford) Capacity

func (v Ford) Capacity() int64

Capacity implements the api.Vehicle interface

func (Ford) Identify

func (v Ford) Identify() (string, error)

Identify implements the api.Identifier interface

func (*Ford) Range

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

Range implements the api.VehicleRange interface

func (*Ford) RefreshToken

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

Refresh implements oauth.TokenRefresher

func (*Ford) SoC

func (v *Ford) SoC() (float64, error)

SoC implements the api.Battery interface

func (*Ford) Status

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

Status implements the api.ChargeState interface

func (Ford) Title

func (v Ford) Title() string

Title implements the api.Vehicle interface

type Hyundai

type Hyundai struct {
	*bluelink.Provider
	// contains filtered or unexported fields
}

Hyundai is an api.Vehicle implementation

func (Hyundai) Capacity

func (v Hyundai) Capacity() int64

Capacity implements the api.Vehicle interface

func (Hyundai) Identify

func (v Hyundai) Identify() (string, error)

Identify implements the api.Identifier interface

func (Hyundai) Title

func (v Hyundai) Title() string

Title implements the api.Vehicle interface

type ID

type ID struct {
	*id.Provider // provides the api implementations
	// contains filtered or unexported fields
}

ID is an api.Vehicle implementation for ID cars

func (ID) Capacity

func (v ID) Capacity() int64

Capacity implements the api.Vehicle interface

func (ID) Identify

func (v ID) Identify() (string, error)

Identify implements the api.Identifier interface

func (ID) Title

func (v ID) Title() string

Title implements the api.Vehicle interface

type Kia

type Kia struct {
	*bluelink.Provider // provides the api implementations
	// contains filtered or unexported fields
}

Kia is an api.Vehicle implementation

func (Kia) Capacity

func (v Kia) Capacity() int64

Capacity implements the api.Vehicle interface

func (Kia) Identify

func (v Kia) Identify() (string, error)

Identify implements the api.Identifier interface

func (Kia) Title

func (v Kia) Title() string

Title implements the api.Vehicle interface

type Nissan

type Nissan struct {
	*nissan.Provider
	// contains filtered or unexported fields
}

Nissan is an api.Vehicle implementation for Nissan cars

func (Nissan) Capacity

func (v Nissan) Capacity() int64

Capacity implements the api.Vehicle interface

func (Nissan) Identify

func (v Nissan) Identify() (string, error)

Identify implements the api.Identifier interface

func (Nissan) Title

func (v Nissan) Title() string

Title implements the api.Vehicle interface

type Niu

type Niu struct {
	*request.Helper
	// contains filtered or unexported fields
}

Niu is an api.Vehicle implementation for Niu vehicles

func (Niu) Capacity

func (v Niu) Capacity() int64

Capacity implements the api.Vehicle interface

func (Niu) Identify

func (v Niu) Identify() (string, error)

Identify implements the api.Identifier interface

func (*Niu) Range

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

Range implements the api.VehicleRange interface

func (*Niu) SoC

func (v *Niu) SoC() (float64, error)

SoC implements the api.Vehicle interface

func (*Niu) Status

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

Status implements the api.ChargeState interface

func (Niu) Title

func (v Niu) Title() string

Title implements the api.Vehicle interface

type Ovms

type Ovms struct {
	*request.Helper
	// contains filtered or unexported fields
}

OVMS is an api.Vehicle implementation for dexters-web server requests

func (Ovms) Capacity

func (v Ovms) Capacity() int64

Capacity implements the api.Vehicle interface

func (*Ovms) FinishTime

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

FinishTime implements the api.VehicleFinishTimer interface

func (Ovms) Identify

func (v Ovms) Identify() (string, error)

Identify implements the api.Identifier interface

func (*Ovms) Range

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

Range implements the api.VehicleRange interface

func (*Ovms) SoC

func (v *Ovms) SoC() (float64, error)

SoC implements the api.Vehicle interface

func (*Ovms) Status

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

Status implements the api.ChargeState interface

func (Ovms) Title

func (v Ovms) Title() string

Title implements the api.Vehicle interface

type PSA

type PSA struct {
	*psa.Provider // provides the api implementations
	// contains filtered or unexported fields
}

PSA is an api.Vehicle implementation for PSA cars

func (PSA) Capacity

func (v PSA) Capacity() int64

Capacity implements the api.Vehicle interface

func (PSA) Identify

func (v PSA) Identify() (string, error)

Identify implements the api.Identifier interface

func (PSA) Title

func (v PSA) Title() string

Title implements the api.Vehicle interface

type Porsche

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

Porsche is an api.Vehicle implementation for Porsche cars

func (Porsche) Capacity

func (v Porsche) Capacity() int64

Capacity implements the api.Vehicle interface

func (Porsche) Identify

func (v Porsche) Identify() (string, error)

Identify implements the api.Identifier interface

func (Porsche) Title

func (v Porsche) Title() string

Title implements the api.Vehicle interface

type Renault

type Renault struct {
	*request.Helper
	// contains filtered or unexported fields
}

Renault is an api.Vehicle implementation for Renault cars

func (Renault) Capacity

func (v Renault) Capacity() int64

Capacity implements the api.Vehicle interface

func (*Renault) Climater

func (v *Renault) Climater() (active bool, outsideTemp float64, targetTemp float64, err error)

Climater implements the api.VehicleClimater interface

func (*Renault) FinishTime

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

FinishTime implements the api.VehicleFinishTimer interface

func (Renault) Identify

func (v Renault) Identify() (string, error)

Identify implements the api.Identifier interface

func (*Renault) Range

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

Range implements the api.VehicleRange interface

func (*Renault) SoC

func (v *Renault) SoC() (float64, error)

SoC implements the api.Vehicle interface

func (*Renault) Status

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

Status implements the api.ChargeState interface

func (Renault) Title

func (v Renault) Title() string

Title implements the api.Vehicle interface

type Seat

type Seat struct {
	*vw.Provider // provides the api implementations
	// contains filtered or unexported fields
}

Seat is an api.Vehicle implementation for Seat cars

func (Seat) Capacity

func (v Seat) Capacity() int64

Capacity implements the api.Vehicle interface

func (Seat) Identify

func (v Seat) Identify() (string, error)

Identify implements the api.Identifier interface

func (Seat) Title

func (v Seat) Title() string

Title implements the api.Vehicle interface

type Skoda

type Skoda struct {
	*vw.Provider // provides the api implementations
	// contains filtered or unexported fields
}

Skoda is an api.Vehicle implementation for Skoda cars

func (Skoda) Capacity

func (v Skoda) Capacity() int64

Capacity implements the api.Vehicle interface

func (Skoda) Identify

func (v Skoda) Identify() (string, error)

Identify implements the api.Identifier interface

func (Skoda) Title

func (v Skoda) Title() string

Title implements the api.Vehicle interface

type Tesla

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

Tesla is an api.Vehicle implementation for Tesla cars

func (Tesla) Capacity

func (v Tesla) Capacity() int64

Capacity implements the api.Vehicle interface

func (*Tesla) ChargedEnergy

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

ChargedEnergy implements the api.ChargeRater interface

func (*Tesla) FinishTime

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

FinishTime implements the api.VehicleFinishTimer interface

func (Tesla) Identify

func (v Tesla) Identify() (string, error)

Identify implements the api.Identifier interface

func (*Tesla) Range

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

Range implements the api.VehicleRange interface

func (*Tesla) SoC

func (v *Tesla) SoC() (float64, error)

SoC implements the api.Vehicle interface

func (*Tesla) StartCharge

func (v *Tesla) StartCharge() error

StartCharge implements the api.VehicleStartCharge interface

func (*Tesla) Status

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

Status implements the api.ChargeState interface

func (*Tesla) StopCharge

func (v *Tesla) StopCharge() error

StopCharge implements the api.VehicleStopCharge interface

func (Tesla) Title

func (v Tesla) Title() string

Title implements the api.Vehicle interface

type Tokens

type Tokens struct {
	Access, Refresh string
}

Tokens contains access and refresh tokens

func (*Tokens) Error

func (t *Tokens) Error() error

Error validates the token and returns an error if they are incomplete

type Tronity

type Tronity struct {
	*request.Helper
	// contains filtered or unexported fields
}

Tronity is an api.Vehicle implementation for the Tronity api

func (Tronity) Capacity

func (v Tronity) Capacity() int64

Capacity implements the api.Vehicle interface

func (Tronity) Identify

func (v Tronity) Identify() (string, error)

Identify implements the api.Identifier interface

func (*Tronity) Range

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

Range implements the api.VehicleRange interface

func (*Tronity) RefreshToken

func (v *Tronity) RefreshToken(_ *oauth2.Token) (*oauth2.Token, error)

RefreshToken performs token refresh by logging in with app context

func (*Tronity) SoC

func (v *Tronity) SoC() (float64, error)

SoC implements the api.Vehicle interface

func (*Tronity) StartCharge

func (v *Tronity) StartCharge() error

StartCharge implements the api.VehicleStartCharge interface

func (*Tronity) Status

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

Status implements the api.ChargeState interface

func (*Tronity) StopCharge

func (v *Tronity) StopCharge() error

StopCharge implements the api.VehicleStopCharge interface

func (Tronity) Title

func (v Tronity) Title() string

Title implements the api.Vehicle interface

type VW

type VW struct {
	*vw.Provider // provides the api implementations
	// contains filtered or unexported fields
}

VW is an api.Vehicle implementation for VW cars

func (VW) Capacity

func (v VW) Capacity() int64

Capacity implements the api.Vehicle interface

func (VW) Identify

func (v VW) Identify() (string, error)

Identify implements the api.Identifier interface

func (VW) Title

func (v VW) Title() string

Title implements the api.Vehicle interface

type Vehicle

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

Vehicle is an api.Vehicle implementation with configurable getters and setters.

func (Vehicle) Capacity

func (v Vehicle) Capacity() int64

Capacity implements the api.Vehicle interface

func (Vehicle) Identify

func (v Vehicle) Identify() (string, error)

Identify implements the api.Identifier interface

func (*Vehicle) SoC

func (v *Vehicle) SoC() (float64, error)

SoC implements the api.Vehicle interface

func (Vehicle) Title

func (v Vehicle) Title() string

Title implements the api.Vehicle interface

type Volvo

type Volvo struct {
	*request.Helper
	// contains filtered or unexported fields
}

Volvo is an api.Vehicle implementation for Volvo cars

func (Volvo) Capacity

func (v Volvo) Capacity() int64

Capacity implements the api.Vehicle interface

func (*Volvo) FinishTime

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

FinishTime implements the VehicleFinishTimer interface

func (Volvo) Identify

func (v Volvo) Identify() (string, error)

Identify implements the api.Identifier interface

func (*Volvo) Range

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

VehicleRange implements the api.VehicleRange interface

func (*Volvo) SoC

func (v *Volvo) SoC() (float64, error)

SoC implements the api.Vehicle interface

func (*Volvo) Status

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

Status implements the api.ChargeState interface

func (Volvo) Title

func (v Volvo) Title() string

Title implements the api.Vehicle interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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