Documentation ¶
Index ¶
- Constants
- func NewIdentity(log *util.Logger, brand, user string, oc *oauth2.Config, token *oauth2.Token) (oauth2.TokenSource, error)
- func Oauth2Config(brand, country string) *oauth2.Config
- type API
- type Duration
- type Energy
- 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) Position() (float64, float64, error)
- func (v *Provider) Range() (int64, error)
- func (v *Provider) Soc() (float64, error)
- func (v *Provider) Status() (api.ChargeStatus, error)
- type Status
- type Vehicle
Constants ¶
View Source
const BaseURL = "https://api.groupe-psa.com/connectedcar/v4"
BaseURL is the API base url
Variables ¶
This section is empty.
Functions ¶
func NewIdentity ¶
func NewIdentity(log *util.Logger, brand, user string, oc *oauth2.Config, token *oauth2.Token) (oauth2.TokenSource, error)
NewIdentity creates PSA identity
func Oauth2Config ¶
Types ¶
type API ¶
API is an api.Vehicle implementation for PSA cars
type Duration ¶
Duration is a time.Duration that can be unmarshalled from JSON
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type Energy ¶
type Energy struct { UpdatedAt time.Time Type string // Fuel/Electric Level float64 Autonomy int Charging struct { Plugged bool Status string // InProgress RemainingTime Duration ChargingRate int ChargingMode string // "Slow" NextDelayedTime Duration } }
Energy is the /status partial energy response
type Identity ¶
type Identity struct { oauth2.TokenSource // contains filtered or unexported fields }
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is an api.Vehicle implementation for PSA cars
func NewProvider ¶
NewProvider creates a vehicle api provider
func (*Provider) FinishTime ¶
FinishTime implements the api.VehicleFinishTimer interface
type Status ¶
type Status struct { Battery struct { Capacity int64 Health struct { Capacity int64 Resistance int64 } } Charging struct { ChargingMode string ChargingRate int64 NextDelayedTime string Plugged bool RemainingTime string Status string } Preconditionning struct { AirConditioning struct { UpdatedAt time.Time Status string // Disabled } } Energy []Energy Odometer struct { Mileage float64 } LastPosition struct { Type string Geometry struct { Type string Coordinates []float64 } Properties struct { UpdatedAt time.Time Type string Heading int } } }
Status is the /status response
Click to show internal directories.
Click to hide internal directories.