Documentation
¶
Index ¶
- Constants
- type API
- func (v *API) Action(vin, pin, action, cmd string) (ActionResponse, error)
- func (v *API) Location(vin string) (LocationResponse, error)
- func (v *API) Status(vin string) (StatusResponse, error)
- func (v *API) UpdateSchedule(vin, pin string, schedules []Schedule) (ActionResponse, error)
- func (v *API) Vehicles() ([]string, error)
- type ActionResponse
- type Controller
- type ErrorInfo
- type Identity
- type LocationResponse
- type PinAuthResponse
- type Provider
- type Schedule
- type StatusResponse
- type TimeMillis
- type Vehicle
- type VehiclesResponse
Constants ¶
View Source
const ( ApiURI = "https://channels.sdpr-01.fcagcv.com" ApiKey = "3_mOx_J2dRgjXYCdyhchv3b5lhi54eBcdCTX4BI8MORqmZCoQWhA0mV2PTlptLGUQI" XApiKey = "qLYupk65UU1tw2Ih1cJhs4izijgRDbir2UFHA3Je" AuthURI = "https://mfa.fcl-01.fcagcv.com" XAuthApiKey = "JWRYW7IYhW9v0RqDghQSx4UcRYRILNmc8zAuh5ys" )
View Source
const ( LoginURI = "https://loginmyuconnect.fiat.com" TokenURI = "https://authz.sdpr-01.fcagcv.com/v2/cognito/identity/token" Region = "eu-west-1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API is an api.Vehicle implementation for Fiat cars
func (*API) UpdateSchedule ¶
func (v *API) UpdateSchedule(vin, pin string, schedules []Schedule) (ActionResponse, error)
type ActionResponse ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(provider *Provider, api *API, vin string, pin string) *Controller
NewController creates a vehicle current and charge controller
func (*Controller) ChargeEnable ¶
func (c *Controller) ChargeEnable(enable bool) error
ChargeEnable implements the api.ChargeController interface
func (*Controller) MaxCurrent ¶
func (c *Controller) MaxCurrent(current int64) error
MaxCurrent implements the api.CurrentController interface
type Identity ¶
func NewIdentity ¶
NewIdentity creates Fiat identity
type LocationResponse ¶
type PinAuthResponse ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func NewProvider ¶
type Schedule ¶
type Schedule struct { CabinPriority bool `json:"cabinPriority"` ChargeToFull bool `json:"chargeToFull"` EnableScheduleType bool `json:"enableScheduleType"` EndTime string `json:"endTime"` RepeatSchedule bool `json:"repeatSchedule"` ScheduleType string `json:"scheduleType"` ScheduledDays struct { Friday bool `json:"friday"` Monday bool `json:"monday"` Saturday bool `json:"saturday"` Sunday bool `json:"sunday"` Thursday bool `json:"thursday"` Tuesday bool `json:"tuesday"` Wednesday bool `json:"wednesday"` } `json:"scheduledDays"` StartTime string `json:"startTime"` }
type StatusResponse ¶
type StatusResponse struct { VehicleInfo struct { Odometer struct { Odometer struct { Value int `json:",string"` Unit string } } Timestamp TimeMillis } EvInfo *struct { Battery struct { ChargingLevel string // LEVEL_2 ChargingStatus string // CHARGING DistanceToEmpty struct { Value int Unit string } PlugInStatus bool // true StateOfCharge float64 // 75 TimeToFullyChargeL1 int // 0 TimeToFullyChargeL2 int // 540 TotalRange int // 17 } Schedules []Schedule Timestamp TimeMillis } `json:",omitempty"` Timestamp TimeMillis }
type TimeMillis ¶
TimeMillis implements JSON unmarshal for Unix timestamps in milliseconds
func (*TimeMillis) UnmarshalJSON ¶
func (ct *TimeMillis) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes unix timestamps in ms into time.Time
type VehiclesResponse ¶
type VehiclesResponse struct {
Vehicles []Vehicle
}
Click to show internal directories.
Click to hide internal directories.