skoda

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const BaseURI = "https://api.connect.skoda-auto.cz/api"

Variables

This section is empty.

Functions

func Refresher

func Refresher(log *util.Logger, login func() (oauth.Token, error)) oauth.TokenRefresher

Types

type API

type API struct {
	*request.Helper
}

API is the Skoda api client

func NewAPI

func NewAPI(log *util.Logger, identity oauth2.TokenSource) *API

NewAPI creates a new api client

func (*API) Charger

func (v *API) Charger(vin string) (ChargerResponse, error)

Charger implements the /v1/charging/<vin>/status response

func (*API) Vehicles

func (v *API) Vehicles() ([]string, error)

Vehicles implements the /vehicles response

type ChargerResponse

type ChargerResponse struct {
	Plug struct {
		ConnectionState string // Connected
		LockState       string // Unlocked
	}
	Charging struct {
		State                           string // Error
		RemainingToCompleteInSeconds    int64
		ChargingPowerInWatts            float64
		ChargingRateInKilometersPerHour float64
		ChargingType                    string // Invalid
		ChargeMode                      string // MANUAL
	}
	Battery struct {
		CruisingRangeElectricInMeters int64
		StateOfChargeInPercent        int
	}
}

ChargerResponse is the /v1/charging/<vin>/status api

type Provider

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

Provider implements the evcc vehicle api

func NewProvider

func NewProvider(api *API, vin string, cache time.Duration) *Provider

NewProvider provides the evcc vehicle api provider

func (*Provider) FinishTime

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

FinishTime implements the api.VehicleFinishTimer interface

func (*Provider) Range

func (v *Provider) Range() (rng int64, err 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

type Vehicle

type Vehicle struct {
	ID, VIN       string
	LastUpdatedAt string
	Specification struct {
		Title, Brand, Model string
		Battery             struct {
			CapacityInKWh int
		}
	}
}

Vehicle is the /v2/garage/vehicles api

Jump to

Keyboard shortcuts

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