cupra

package
v0.0.0-...-175a4df Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BaseURL is the API base url
	BaseURL = "https://ola.prod.code.seat.cloud.vwgroup.com"

	ActionCharge      = "charging"
	ActionChargeStart = "start"
	ActionChargeStop  = "stop"
)

Variables

View Source
var AuthParams = url.Values{
	"response_type": {"code id_token"},
	"client_id":     {"30e33736-c537-4c72-ab60-74a7b92cfe83@apps_vw-dilab_com"},
	"redirect_uri":  {"cupraconnect://identity-kit/login"},
	"scope":         {"openid profile mbb"},
}

Authorization parameters

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

TokenRefreshService parameters

Functions

This section is empty.

Types

type API

type API struct {
	*request.Helper
}

API is an api.Vehicle implementation for Seat Cupra cars

func NewAPI

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

NewAPI creates a new vehicle

func (*API) Action

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

Action implements the /requests response

func (*API) Status

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

Status implements the /status response

func (*API) Vehicles

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

Vehicles implements the /vehicles response

type Engine

type Engine struct {
	Type     string
	FuelType string
	Range    struct {
		Value float64
		Unit  string
	}
	Level float64
}

type Provider

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

Provider is an api.Vehicle implementation for Seat Cupra cars

func NewProvider

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

NewProvider creates a vehicle api provider

func (*Provider) Climater

func (v *Provider) Climater() (bool, error)

Climater implements the api.VehicleClimater interface

func (*Provider) FinishTime

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

FinishTime implements the api.VehicleFinishTimer interface

func (*Provider) Odometer

func (v *Provider) Odometer() (float64, error)

Odometer implements the api.VehicleOdometer interface

func (*Provider) Range

func (v *Provider) Range() (int64, error)

Range implements the api.VehicleRange interface

func (*Provider) Soc

func (v *Provider) Soc() (float64, error)

Soc implements the api.Vehicle interface

func (*Provider) StartCharge

func (v *Provider) StartCharge() error

StartCharge implements the api.VehicleChargeController interface

func (*Provider) Status

func (v *Provider) Status() (api.ChargeStatus, error)

Status implements the api.ChargeState interface

func (*Provider) StopCharge

func (v *Provider) StopCharge() error

StopCharge implements the api.VehicleChargeController interface

func (*Provider) TargetSoc

func (v *Provider) TargetSoc() (float64, error)

TargetSoc implements the api.SocLimiter interface

type Status

type Status struct {
	Engines struct {
		Primary, Secondary Engine
	}
	Services struct {
		Charging struct {
			Status         string
			TargetPct      int
			ChargeMode     string
			Active         bool
			RemainingTime  int64
			ProgressBarPct float64
		}
		Climatisation struct {
			Status         string
			Active         bool
			RemainingTime  int64
			ProgressBarPct float64
		}
	}
	Measurements struct {
		MileageKm float64
	}
}

type Vehicle

type Vehicle struct {
	VIN              string
	EnrollmentStatus string
	UserRole         string
	VehicleNickname  string
}

Jump to

Keyboard shortcuts

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