Documentation ¶
Index ¶
- Variables
- func GetStampFromList(b Brand) (string, error)
- type Brand
- type Client
- type ClientOptions
- type Config
- type HttpClient
- type PlugType
- type Region
- type StartOptions
- type Vehicle
- func (v *Vehicle) Brand() Brand
- func (v *Vehicle) ID() string
- func (v *Vehicle) Location() (string, error)
- func (v *Vehicle) Lock() error
- func (v *Vehicle) Name() string
- func (v *Vehicle) Odometer() (string, error)
- func (v *Vehicle) Start(...StartOptions) error
- func (v *Vehicle) Status() (*VehicleStatus, error)
- func (v *Vehicle) Stop() error
- func (v *Vehicle) Type() string
- func (v *Vehicle) Unlock() error
- func (v *Vehicle) VIN() string
- type VehicleOption
- type VehicleStatus
- func (v *VehicleStatus) DoorIsLocked() bool
- func (v *VehicleStatus) IsCharging() bool
- func (v *VehicleStatus) MaxRange() int
- func (v *VehicleStatus) RangeLeft() int
- func (v *VehicleStatus) SoC() int
- func (v *VehicleStatus) TargetSocAC() int
- func (v *VehicleStatus) TargetSocDC() int
- func (v *VehicleStatus) UpdatedAt() time.Time
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotImplemented = errors.New("function not implemented") ErrNotAuthenticated = errors.New("client not authenticated") ErrAuthenticationFailed = errors.New("client authentication failed") ErrUnknownBrand = errors.New("unknown brand") ErrNoVehicleFound = errors.New("no vehicle found") )
View Source
var JSONEncoding = map[string]string{
"Content-Type": "application/json",
"Accept": "application/json",
}
JSONEncoding specifies application/json
Functions ¶
func GetStampFromList ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Authenticate ¶
type ClientOptions ¶
func WithTimeout ¶
func WithTimeout(d time.Duration) ClientOptions
func WithTransport ¶
func WithTransport(rt http.RoundTripper) ClientOptions
type StartOptions ¶
type StartOptions struct{} // ClimateOptions || StartOptions
type Vehicle ¶
type Vehicle struct {
// contains filtered or unexported fields
}
func NewVehicle ¶
func NewVehicle( id, vin, name, vtype string, b Brand, opts ...VehicleOption, ) *Vehicle
func (*Vehicle) Start ¶
func (v *Vehicle) Start(...StartOptions) error
func (*Vehicle) Status ¶
func (v *Vehicle) Status() (*VehicleStatus, error)
type VehicleOption ¶
type VehicleOption func(*Vehicle)
func WithVehicleAuth ¶
func WithVehicleAuth(a auth) VehicleOption
func WithVehicleClient ¶
func WithVehicleClient(h HttpClient) VehicleOption
func WithVehicleEndpoints ¶
func WithVehicleEndpoints(e endpoints) VehicleOption
type VehicleStatus ¶
type VehicleStatus struct {
// contains filtered or unexported fields
}
func (*VehicleStatus) DoorIsLocked ¶
func (v *VehicleStatus) DoorIsLocked() bool
func (*VehicleStatus) IsCharging ¶
func (v *VehicleStatus) IsCharging() bool
func (*VehicleStatus) MaxRange ¶
func (v *VehicleStatus) MaxRange() int
func (*VehicleStatus) RangeLeft ¶
func (v *VehicleStatus) RangeLeft() int
func (*VehicleStatus) SoC ¶
func (v *VehicleStatus) SoC() int
func (*VehicleStatus) TargetSocAC ¶
func (v *VehicleStatus) TargetSocAC() int
func (*VehicleStatus) TargetSocDC ¶
func (v *VehicleStatus) TargetSocDC() int
func (*VehicleStatus) UpdatedAt ¶
func (v *VehicleStatus) UpdatedAt() time.Time
Source Files ¶
Click to show internal directories.
Click to hide internal directories.