porsche

package
v0.0.0-...-e6e1b3f Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientID          = "4mPO3OE5Srjb1iaUGWsbqKBvvesya8oA"
	EmobilityClientID = "gZLSI7ThXFB4d2ld9t8Cx2DBRvGr1zN2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTokens

type AccessTokens struct {
	Token, EmobilityToken oauth2.Token
}

type EMobilityProvider

type EMobilityProvider struct {
	*request.Helper
	// contains filtered or unexported fields
}

EMobilityProvider is an api.Vehicle implementation for Porsche Taycan cars

func NewEMobilityProvider

func NewEMobilityProvider(log *util.Logger, identity *Identity, token oauth2.Token, vin string, cache time.Duration) *EMobilityProvider

NewEMobilityProvider creates a new vehicle

func (*EMobilityProvider) Climater

func (v *EMobilityProvider) Climater() (active bool, outsideTemp float64, targetTemp float64, err error)

Climater implements the api.VehicleClimater interface

func (*EMobilityProvider) FinishTime

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

FinishTime implements the api.VehicleFinishTimer interface

func (*EMobilityProvider) Range

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

Range implements the api.VehicleRange interface

func (*EMobilityProvider) SoC

func (v *EMobilityProvider) SoC() (float64, error)

SoC implements the api.Vehicle interface

func (*EMobilityProvider) Status

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

Status implements the api.ChargeState interface

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

type Identity

type Identity struct {
	*request.Helper
	// contains filtered or unexported fields
}

Identity is the Porsche Identity client

func NewIdentity

func NewIdentity(log *util.Logger, user, password string) *Identity

NewIdentity creates a new Identity client

func (*Identity) FindVehicle

func (v *Identity) FindVehicle(accessTokens AccessTokens, vin string) (Vehicle, error)

func (*Identity) Login

func (v *Identity) Login() (AccessTokens, error)

type Provider

type Provider struct {
	*request.Helper
	// contains filtered or unexported fields
}

Provider is an api.Vehicle implementation for Porsche PHEV cars

func NewProvider

func NewProvider(log *util.Logger, identity *Identity, token oauth2.Token, vin string, cache time.Duration) *Provider

NewProvider creates a new vehicle

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

type StatusResponse

type StatusResponse struct {
	CarControlData struct {
		BatteryLevel struct {
			Unit  string
			Value float64
		}
		Mileage struct {
			Unit  string
			Value float64
		}
		RemainingRanges struct {
			ElectricalRange struct {
				Distance struct {
					Unit  string
					Value float64
				}
			}
		}
	}
}

type Vehicle

type Vehicle struct {
	VIN              string
	EmobilityVehicle bool
}

type VehicleResponse

type VehicleResponse struct {
	VIN              string
	ModelDescription string
}

Jump to

Keyboard shortcuts

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