Documentation ¶
Index ¶
- Constants
- Variables
- func IsPaired(status string) bool
- type API
- type CapabilitiesResponse
- type EmobilityAPI
- type EmobilityResponse
- type Identity
- type Provider
- func (v *Provider) Climater() (bool, error)
- func (v *Provider) FinishTime() (time.Time, error)
- func (v *Provider) Odometer() (float64, error)
- func (v *Provider) Range() (int64, error)
- func (v *Provider) Soc() (float64, error)
- func (v *Provider) Status() (api.ChargeStatus, error)
- func (v *Provider) WakeUp() error
- type StatusResponse
- type Vehicle
- type VehiclePairingResponse
Constants ¶
View Source
const ( ApiURI = "https://api.porsche.com" PairingComplete = "PAIRINGCOMPLETE" PairingInProcess = "INPROCESS" )
View Source
const ( OAuthURI = "https://identity.porsche.com" ClientID = "UYsK00My6bCqJdbQhTQ0PbWmcSdIAMig" )
Variables ¶
View Source
var ( OAuth2Config = &oauth2.Config{ ClientID: ClientID, RedirectURL: "https://my.porsche.com/", Endpoint: oauth2.Endpoint{ AuthURL: OAuthURI + "/authorize", TokenURL: OAuthURI + "/oauth/token", AuthStyle: oauth2.AuthStyleInParams, }, Scopes: []string{"openid", "offline_access"}, } )
https://identity.porsche.com/.well-known/openid-configuration
Functions ¶
Types ¶
type API ¶
API is an api.Vehicle implementation for Porsche PHEV cars
func NewAPI ¶
func NewAPI(log *util.Logger, identity oauth2.TokenSource) *API
NewAPI creates a new vehicle
func (*API) PairingStatus ¶
func (v *API) PairingStatus(vin string) (VehiclePairingResponse, error)
PairingStatus implements the vehicle pairing status response
type CapabilitiesResponse ¶
type CapabilitiesResponse struct { DisplayParkingBrake bool NeedsSPIN bool HasRDK bool EngineType string CarModel string OnlineRemoteUpdateStatus struct { EditableByUser bool Active bool } HeatingCapabilities struct { FrontSeatHeatingAvailable bool RearSeatHeatingAvailable bool } SteeringWheelPosition string HasHonkAndFlash bool }
type EmobilityAPI ¶
EmobilityAPI is the Porsche Emobility API
func NewEmobilityAPI ¶
func NewEmobilityAPI(log *util.Logger, identity oauth2.TokenSource) *EmobilityAPI
NewEmobilityAPI creates a new vehicle
func (*EmobilityAPI) Capabilities ¶
func (v *EmobilityAPI) Capabilities(vin string) (CapabilitiesResponse, error)
func (*EmobilityAPI) Status ¶
func (v *EmobilityAPI) Status(vin, model string) (EmobilityResponse, error)
Status implements the vehicle status response
type EmobilityResponse ¶
type EmobilityResponse struct { BatteryChargeStatus *struct { ChargeRate struct { Unit string Value float64 ValueInKmPerHour int64 } ChargingInDCMode bool ChargingMode string ChargingPower float64 ChargingReason string ChargingState string ChargingTargetDateTime string ExternalPowerSupplyState string PlugState string RemainingChargeTimeUntil100PercentInMinutes int64 StateOfChargeInPercentage int64 RemainingERange struct { OriginalUnit string OriginalValue int64 Unit string Value int64 ValueInKilometers int64 } } ChargingStatus string DirectCharge struct { Disabled bool IsActive bool } DirectClimatisation struct { ClimatisationState string RemainingClimatisationTime int64 } PcckErrorMessage string }
type Identity ¶
Identity is the Porsche Identity client
func NewIdentity ¶
NewIdentity creates Porsche identity
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is an api.Vehicle implementation for Porsche PHEV cars
func NewProvider ¶
func NewProvider(log *util.Logger, connect *API, emobility *EmobilityAPI, vin, carModel string, cache time.Duration) *Provider
NewProvider creates a vehicle api provider
func (*Provider) FinishTime ¶
FinishTime implements the api.VehicleFinishTimer interface
type StatusResponse ¶
Click to show internal directories.
Click to hide internal directories.