hello

package
v0.0.0-...-6d7b8bb Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiURI = "https://api.ecloudeu.com"
	ApiKey = "3_L94eyQ-wvJhWm7Afp1oBhfTGXZArUfSHHW9p9Pncg513hZELXsxCfMWHrF8f5P5a"
)
View Source
const ResponseOK = 1000

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(log *util.Logger, identity *Identity) *API

func (*API) Status

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

func (*API) UpdateSession

func (v *API) UpdateSession(vin string) error

func (*API) Vehicles

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

type AppToken

type AppToken struct {
	ExpiresIn    int
	AccessToken  string
	UserId       string
	RefreshToken string
}

type Bool

type Bool bool

func (*Bool) UnmarshalJSON

func (rc *Bool) UnmarshalJSON(data []byte) error

type Error

type Error struct {
	Code    Int
	Message string
}

type Identity

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

func NewIdentity

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

func (*Identity) DeviceID

func (v *Identity) DeviceID() string

func (*Identity) RefreshToken

func (v *Identity) RefreshToken(_ *oauth2.Token) (*oauth2.Token, error)

func (*Identity) UserID

func (v *Identity) UserID() (string, error)

type Int

type Int int

func (*Int) UnmarshalJSON

func (rc *Int) UnmarshalJSON(data []byte) error

type Provider

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

func NewProvider

func NewProvider(log *util.Logger, api *API, vin string, cache time.Duration) *Provider

func (*Provider) Climater

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

Climater implements the api.VehicleClimater interface

func (*Provider) Odometer

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

Odometer implements the Provider.VehicleOdometer interface

func (*Provider) Position

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

Position implements the api.VehiclePosition 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) Status

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

Status implements the api.ChargeState interface

type Vehicle

type Vehicle struct {
	VIN string
}

type VehicleStatus

type VehicleStatus struct {
	BasicVehicleStatus struct {
		UsageMode    Int    `json:"usageMode"`    // "0",
		EngineStatus string `json:"engineStatus"` // "engine_off",
		Position     struct {
			Altitude               Int  `json:"altitude"`               // "117",
			PosCanBeTrusted        Bool `json:"posCanBeTrusted"`        // "true",
			Latitude               Int  `json:"latitude"`               // "18...",
			CarLocatorStatUploadEn Bool `json:"carLocatorStatUploadEn"` // "true",
			Longitude              Int  `json:"longitude"`              // "28..."
		}
		DistanceToEmpty Int     `json:"distanceToEmpty"` // "0",
		CarMode         Int     `json:"carMode"`         // "0",
		Speed           float64 `json:"speed,string"`    // "0.0",
		SpeedValidity   Bool    `json:"speedValidity"`   // "true",
		Direction       Int     `json:"direction"`       // "277"
	}
	UpdateTime              int64 `json:"updateTime,string"` // "1703072512182",
	AdditionalVehicleStatus struct {
		MaintenanceStatus struct {
			TyreTempWarningPassengerRear Int     `json:"tyreTempWarningPassengerRear"` // "0",
			DaysToService                Int     `json:"daysToService"`                // "455",
			EngineHrsToService           Int     `json:"engineHrsToService"`           // "500",
			Odometer                     float64 `json:"odometer,string"`              // "7854.000",
			BrakeFluidLevelStatus        Int     `json:"brakeFluidLevelStatus"`        // "3",
			MainBatteryStatus            struct {
				StateOfCharge Int     `json:"stateOfCharge"`      // "1",
				ChargeLevel   float64 `json:"chargeLevel,string"` // "0.0",
				EnergyLevel   Int     `json:"energyLevel"`        // "0",
				StateOfHealth Int     `json:"stateOfHealth"`      // "0",
				PowerLevel    Int     `json:"powerLevel"`         // "0",
				Voltage       float64 `json:"voltage,string"`     // "5.000"
			}
		}
		ElectricVehicleStatus struct {
			DisChargeUAct                  float64 `json:"disChargeUAct,string"`           // "0.0",
			DisChargeSts                   Int     `json:"disChargeSts"`                   // "0",
			WptFineAlignt                  Int     `json:"wptFineAlignt"`                  // "0",
			ChargeLidAcStatus              Int     `json:"chargeLidAcStatus"`              // "2",
			DistanceToEmptyOnBatteryOnly   Int     `json:"distanceToEmptyOnBatteryOnly"`   // "233",
			DistanceToEmptyOnBattery100Soc Int     `json:"distanceToEmptyOnBattery100Soc"` // "330",
			ChargeSts                      Int     `json:"chargeSts"`                      // "0",
			AverPowerConsumption           float64 `json:"averPowerConsumption,string"`    // "-85.5",
			ChargerState                   Int     `json:"chargerState"`                   // "0",
			TimeToTargetDisCharged         Int     `json:"timeToTargetDisCharged"`         // "2047",
			DistanceToEmptyOnBattery20Soc  Int     `json:"distanceToEmptyOnBattery20Soc"`  // "66",
			DisChargeConnectStatus         Int     `json:"disChargeConnectStatus"`         // "0",
			ChargeLidDcAcStatus            Int     `json:"chargeLidDcAcStatus"`            // "2",
			DcChargeSts                    Int     `json:"dcChargeSts"`                    // "0",
			PtReady                        Int     `json:"ptReady"`                        // "0",
			ChargeLevel                    Int     `json:"chargeLevel"`                    // "76",
			StatusOfChargerConnection      Int     `json:"statusOfChargerConnection"`      // "0",
			DcDcActvd                      Int     `json:"dcDcActvd"`                      // "0",
			IndPowerConsumption            float64 `json:"indPowerConsumption,string"`     // "1000",
			DcDcConnectStatus              Int     `json:"dcDcConnectStatus"`              // "0",
			DisChargeIAct                  float64 `json:"disChargeIAct,string"`           // "0.0",
			DcChargeIAct                   float64 `json:"dcChargeIAct,string"`            // "0.0",
			ChargeUAct                     float64 `json:"chargeUAct,string"`              // "0.0",
			BookChargeSts                  Int     `json:"bookChargeSts"`                  // "0",
			ChargeIAct                     float64 `json:"chargeIAct,string"`              // "0.000",
			TimeToFullyCharged             Int     `json:"timeToFullyCharged"`             // "2047"
		}
		ChargeHvSts   Int `json:"chargeHvSts"` // "1",
		ClimateStatus struct {
			PreClimateActive Bool `json:"preClimateActive"` // false,
			Defrost          Bool `json:"defrost"`          // "false",
		}
	}
}

Jump to

Keyboard shortcuts

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