skoda

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: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ActionCharge      = "charging"
	ActionChargeStart = "Start"
	ActionChargeStop  = "Stop"
)
View Source
const (
	Brand   = "VW"
	Country = "CZ"

	// Authorization ClientID
	AuthClientID = "afb0473b-6d82-42b8-bfea-cead338c46ef"
)
View Source
const BaseURI = "https://api.connect.skoda-auto.cz/api"

Variables

View Source
var AuthParams = url.Values{
	"response_type": {"code id_token"},
	"client_id":     {"f9a2359a-b776-46d9-bd0c-db1904343117@apps_vw-dilab_com"},
	"redirect_uri":  {"skodaconnect://oidc.login/"},
	"scope":         {"openid mbb profile"},
}

Skoda native api

View Source
var TRSParams = url.Values{
	"brand": {"skoda"},
}

TokenRefreshService parameters

Functions

This section is empty.

Types

type API

type API struct {
	*request.Helper
}

API is the Skoda api client

func NewAPI

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

NewAPI creates a new api client

func (*API) Action

func (v *API) Action(vin, action, value string) error

Action executes a vehicle action

func (*API) Charger

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

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

func (*API) Settings

func (v *API) Settings(vin string) (SettingsResponse, error)

Settings implements the /v1/charging/<vin>/settings response

func (*API) Status

func (v *API) Status(vin string) (StatusResponse, error)

Status implements the /v2/vehicle-status/<vin> response

func (*API) Vehicles

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

Vehicles implements the /v3/garage 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 vehicle api

func NewProvider

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

NewProvider creates a vehicle api provider

func (*Provider) ChargeEnable

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

ChargeEnable implements the api.ChargeController 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() (odo float64, err error)

Odometer implements the api.VehicleOdometer 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 SettingsResponse

type SettingsResponse struct {
	AutoUnlockPlugWhenCharged    string `json:"autoUnlockPlugWhenCharged"`
	MaxChargeCurrentAc           string `json:"maxChargeCurrentAc"`
	TargetStateOfChargeInPercent int    `json:"targetStateOfChargeInPercent"`
}

SettingsResponse is the /v1/charging/<vin>/settings api

type Specification

type Specification struct {
	Title         string
	Model         string
	ModelYear     string
	Body          string
	SystemCode    string
	SystemModelId string
	Engine        struct {
		Typ       string `json:"type"`
		PowerInKW int
	}
	Battery struct {
		CapacityInKWh int
	}
	Gearbox struct {
		Typ string `json:"type"`
	}
	TrimLevel            string
	ManufacturingDate    string
	MaxChargingPowerInKW int
}

type StatusResponse

type StatusResponse struct {
	Remote struct {
		MileageInKm float64
	}
}

StatusResponse is the /v2/vehicle-status/<vin> api

type Vehicle

type Vehicle struct {
	ID, VIN       string
	Name          string // user-given name
	LastUpdatedAt string
	Specification Specification
}

type VehiclesResponse

type VehiclesResponse struct {
	Vehicles []Vehicle
}

VehiclesResponse is the /v3/garage api

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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