Documentation ¶
Index ¶
- Constants
- Variables
- type API
- func (v *API) Action(vin, action, value string) error
- func (v *API) Any(base, vin string) (interface{}, error)
- func (v *API) Charger(vin string) (ChargerResponse, error)
- func (v *API) Climater(vin string) (ClimaterResponse, error)
- func (v *API) HomeRegion(vin string) error
- func (v *API) Position(vin string) (PositionResponse, error)
- func (v *API) RolesRights(vin string) (RolesRights, error)
- func (v *API) ServiceURI(vin, service string, rr RolesRights) (uri string)
- func (v *API) Status(vin string) (StatusResponse, error)
- type ChargerResponse
- type ClimaterResponse
- type Error
- type FieldDefinition
- type HomeRegion
- type PositionResponse
- type Provider
- func (v *Provider) ChargeEnable(enable bool) error
- func (v *Provider) Climater() (bool, error)
- func (v *Provider) Diagnose()
- func (v *Provider) FinishTime() (time.Time, error)
- func (v *Provider) Odometer() (float64, error)
- func (v *Provider) Position() (float64, float64, error)
- func (v *Provider) Range() (rng int64, err error)
- func (v *Provider) Soc() (float64, error)
- func (v *Provider) Status() (api.ChargeStatus, error)
- type RolesRights
- type ServiceDefinition
- type ServiceInfo
- type StatusResponse
- type TimedInt
- type TimedString
- type TimedTemperature
- type VehiclesResponse
Constants ¶
const ( ActionCharge = "batterycharge" ActionChargeStart = "start" ActionChargeStop = "stop" )
const ( Brand = "VW" Country = "DE" // Authorization ClientID AuthClientID = "38761134-34d0-41f3-9a73-c4be88d7d337" )
const DefaultBaseURI = "https://msg.volkswagen.de/fs-car"
DefaultBaseURI is the VW api base URI
const RegionAPI = "https://mal-1a.prd.ece.vwg-connect.com/api"
RegionAPI is the VW api used for determining the home region
const ServiceOdometer = "0x0101010002"
const StatusService = "statusreport_v1"
Variables ¶
var AuthParams = url.Values{
"response_type": {"code id_token token"},
"client_id": {"9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com"},
"redirect_uri": {"carnet://identity-kit/login"},
"scope": {"openid profile mbb"},
}
Authorization parameters
var TRSParams = url.Values{
"brand": {"vw"},
}
TokenRefreshService parameters
Functions ¶
This section is empty.
Types ¶
type API ¶
API is the VW api client
func (*API) Charger ¶
func (v *API) Charger(vin string) (ChargerResponse, error)
Charger implements the /charger response
func (*API) Climater ¶
func (v *API) Climater(vin string) (ClimaterResponse, error)
Climater implements the /climater response
func (*API) HomeRegion ¶
HomeRegion updates the home region for the given vehicle
func (*API) Position ¶
func (v *API) Position(vin string) (PositionResponse, error)
Position implements the /position response
func (*API) RolesRights ¶
func (v *API) RolesRights(vin string) (RolesRights, error)
RolesRights implements the /rolesrights/operationlist response
func (*API) ServiceURI ¶
func (v *API) ServiceURI(vin, service string, rr RolesRights) (uri string)
ServiceURI renders the service URI for the given vin and service
type ChargerResponse ¶
type ChargerResponse struct { Charger struct { Status struct { BatteryStatusData struct { StateOfCharge TimedInt RemainingChargingTime TimedInt } ChargingStatusData struct { ChargingState TimedString // off, charging ChargingMode TimedString // invalid, AC ChargingReason TimedString // invalid, immediate ExternalPowerSupplyState TimedString // unavailable, available EnergyFlow TimedString // on, off } PlugStatusData struct { PlugState TimedString // connected } CruisingRangeStatusData struct { EngineTypeFirstEngine TimedString // typeIsElectric, petrolGasoline EngineTypeSecondEngine TimedString // typeIsElectric, petrolGasoline PrimaryEngineRange TimedInt SecondaryEngineRange TimedInt HybridRange TimedInt } } } Error *Error // optional error }
ChargerResponse is the /bs/batterycharge/v1/%s/%s/vehicles/%s/charger api
type ClimaterResponse ¶
type ClimaterResponse struct { Climater struct { Settings struct { TargetTemperature TimedTemperature HeaterSource TimedString } Status struct { ClimatisationStatusData struct { ClimatisationState TimedString ClimatisationReason TimedString RemainingClimatisationTime TimedInt } TemperatureStatusData struct { OutdoorTemperature TimedTemperature } VehicleParkingClockStatusData struct { VehicleParkingClock TimedString } } } Error *Error // optional error }
ClimaterResponse is the /bs/climatisation/v1/%s/%s/vehicles/%s/climater api
type FieldDefinition ¶
type FieldDefinition struct { ID string // "0x0101010001", TsCarSentUtc string // "2021-09-05T07:54:20Z", TsCarSent string // "2021-09-05T07:54:19", TsCarCaptured string // "2021-09-05T07:54:19", TsTssReceivedUtc string // "2021-09-05T07:54:23Z", MilCarCaptured int // 25009, MilCarSent int // 25009, Value string // "echo" }
type HomeRegion ¶
type HomeRegion struct { HomeRegion struct { BaseURI struct { SystemID string Content string // api url } } Error *Error // optional error }
HomeRegion is the home region API response
type PositionResponse ¶
type PositionResponse struct { FindCarResponse struct { Position struct { TimestampCarSent string // "2021-12-12T16:42:44" TimestampTssReceived time.Time CarCoordinate struct { Latitude int64 Longitude int64 } TimestampCarSentUTC time.Time TimestampCarCaptured string // "2021-12-12T16:42:44" } ParkingTimeUTC time.Time } Error *Error // optional error }
PositionResponse is the /bs/cf/v1/%s/%s/vehicles/%s/position 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) Diagnose ¶
func (v *Provider) Diagnose()
Diagnose implements the api.Diagnosis interface
func (*Provider) FinishTime ¶
FinishTime implements the api.VehicleFinishTimer interface
type RolesRights ¶
type RolesRights struct { OperationList struct { VIN, UserId, Role, Status string ServiceInfo []ServiceInfo } }
RolesRights is the /rolesrights/operationlist response
func (RolesRights) ServiceByID ¶
func (rr RolesRights) ServiceByID(id string) *ServiceInfo
type ServiceDefinition ¶
type ServiceDefinition struct { ID string Field []FieldDefinition }
func (*ServiceDefinition) FieldByID ¶
func (s *ServiceDefinition) FieldByID(id string) *FieldDefinition
type ServiceInfo ¶
type ServiceInfo struct { ServiceId string ServiceType string ServiceStatus struct { Status string } LicenseRequired bool CumulatedLicense map[string]interface{} PrimaryUserRequired bool TermsAndConditionsRequired bool ServiceEol string RolesAndRightsRequired bool InvocationUrl struct { Content string } Operation []map[string]interface{} }
ServiceInfo is the rolesrights service information
type StatusResponse ¶
type StatusResponse struct { StoredVehicleDataResponse struct { VIN string VehicleData struct { Data []ServiceDefinition } } Error *Error }
func (*StatusResponse) ServiceByID ¶
func (s *StatusResponse) ServiceByID(id string) *ServiceDefinition
type TimedString ¶
TimedString is a string value with timestamp
type TimedTemperature ¶
TimedTemperature is the api temperature with timestamp
func (*TimedTemperature) UnmarshalJSON ¶
func (t *TimedTemperature) UnmarshalJSON(data []byte) error
type VehiclesResponse ¶
type VehiclesResponse struct { UserVehicles struct { Vehicle []string } Error *Error // optional error }
VehiclesResponse is the /usermanagement/users/v1/%s/%s/vehicles api