myskoda

package
v0.0.0-...-aa513c4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 9 Imported by: 0

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://mysmob.api.connect.skoda-auto.cz/api"

Variables

View Source
var AuthParams = url.Values{
	"response_type": {"code id_token"},
	"client_id":     {"7f045eee-7003-4379-9968-9355ed2adb06@apps_vw-dilab_com"},
	"redirect_uri":  {"myskoda://redirect/login/"},
	"scope":         {"address badge birthdate cars driversLicense dealers email mileage mbb nationalIdentifier openid phone profession profile vin"},
}

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> response

func (*API) Climater

func (v *API) Climater(vin string) (ClimaterResponse, error)

Climater implements the /v2/air-conditioning/<vin> 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) VehicleDetails

func (v *API) VehicleDetails(vin string) (Vehicle, error)

func (*API) Vehicles

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

Vehicles implements the /v2/garage response

func (*API) WakeUp

func (v *API) WakeUp(vin string) error

type ChargerResponse

type ChargerResponse struct {
	IsVehicleInSaveLocation bool
	Status                  struct {
		ChargingRateInKilometersPerHour      float64
		ChargePowerInKw                      float64
		RemainingTimeToFullyChargedInMinutes int64
		State                                string
		ChargeType                           string
		Battery                              struct {
			RemainingCruisingRangeInMeters int64
			StateOfChargeInPercent         int
		}
	}
	Settings SettingsResponse
}

ChargerResponse is the /v2/charging/<vin> api

type ClimaterResponse

type ClimaterResponse struct {
	State                  string `json:"state"`
	ChargerConnectionState string `json:"chargerConnectionState"`
	ChargerLockState       string `json:"chargerLockState"`
}

ChargerResponse is the /v2/air-conditioning/<vin> 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

func (*Provider) WakeUp

func (v *Provider) WakeUp() error

WakeUp implements the api.Resurrector 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 {
	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