Documentation ¶
Index ¶
- Constants
- Variables
- type API
- type ChargerResponse
- type Provider
- func (v *Provider) ChargeEnable(enable bool) error
- func (v *Provider) FinishTime() (time.Time, error)
- func (v *Provider) GetLimitSoc() (int64, error)
- func (v *Provider) Odometer() (odo float64, err error)
- func (v *Provider) Range() (rng int64, err error)
- func (v *Provider) Soc() (float64, error)
- func (v *Provider) Status() (api.ChargeStatus, error)
- type SettingsResponse
- type Specification
- type StatusResponse
- type Vehicle
- type VehiclesResponse
Constants ¶
const ( ActionCharge = "charging" ActionChargeStart = "Start" ActionChargeStop = "Stop" )
const ( Brand = "VW" Country = "CZ" // Authorization ClientID AuthClientID = "afb0473b-6d82-42b8-bfea-cead338c46ef" )
const BaseURI = "https://api.connect.skoda-auto.cz/api"
Variables ¶
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
var TRSParams = url.Values{
"brand": {"skoda"},
}
TokenRefreshService parameters
Functions ¶
This section is empty.
Types ¶
type API ¶
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) 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
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 ¶
NewProvider creates a vehicle api provider
func (*Provider) ChargeEnable ¶
ChargeEnable implements the api.ChargeController interface
func (*Provider) FinishTime ¶
FinishTime implements the api.VehicleFinishTimer interface
func (*Provider) GetLimitSoc ¶
GetLimitSoc implements the api.SocLimiter 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