Documentation ¶
Index ¶
- Constants
- type API
- type Card
- type CloudResponse
- type LocalAPI
- type Response
- type StatusResponse
- func (g *StatusResponse) ChargedEnergy() float64
- func (g *StatusResponse) CurrentPower() float64
- func (g *StatusResponse) Currents() (float64, float64, float64)
- func (g *StatusResponse) Enabled() bool
- func (g *StatusResponse) Identify() string
- func (g *StatusResponse) Status() int
- func (g *StatusResponse) TotalEnergy() float64
- func (g *StatusResponse) Voltages() (float64, float64, float64)
- type StatusResponse2
- func (g *StatusResponse2) ChargedEnergy() float64
- func (g *StatusResponse2) CurrentPower() float64
- func (g *StatusResponse2) Currents() (float64, float64, float64)
- func (g *StatusResponse2) Enabled() bool
- func (g *StatusResponse2) Identify() string
- func (g *StatusResponse2) Status() int
- func (g *StatusResponse2) TotalEnergy() float64
- func (g *StatusResponse2) Voltages() (float64, float64, float64)
- type UpdateResponse
Constants ¶
View Source
const CloudURI = "https://api.go-e.co"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudResponse ¶
type CloudResponse struct { Success *bool // only valid for cloud payload commands Age int Error string // only valid for cloud payload commands Data StatusResponse }
CloudResponse is the cloud API response
type Response ¶
type Response interface { Status() int Enabled() bool CurrentPower() float64 ChargedEnergy() float64 TotalEnergy() float64 Currents() (float64, float64, float64) Voltages() (float64, float64, float64) Identify() string }
Response is the v1 and v2 api response interface
type StatusResponse ¶
type StatusResponse struct { Fwv string `json:"fwv"` // firmware version Car int `json:"car,string"` // car status Alw int `json:"alw,string"` // allow charging Amp int `json:"amp,string"` // current [A] Err int `json:"err,string"` // error Eto int `json:"eto,string"` // energy total [0.1kWh] Stp int `json:"stp,string"` // stop state Tmp int `json:"tmp,string"` // temperature [°C] Dws int `json:"dws,string"` // energy [Ws] Nrg []float64 `json:"nrg"` // voltage, current, power Uby int `json:"uby,string"` // unlocked_by Rna string `json:"rna"` // RFID 1 Rnm string `json:"rnm"` // RFID 2 Rne string `json:"rne"` // RFID 3 Rn4 string `json:"rn4"` // RFID 4 Rn5 string `json:"rn5"` // RFID 5 Rn6 string `json:"rn6"` // RFID 6 Rn7 string `json:"rn7"` // RFID 7 Rn8 string `json:"rn8"` // RFID 8 Rn9 string `json:"rn9"` // RFID 9 Rn1 string `json:"rn1"` // RFID 10 }
StatusResponse is the API response if status not OK
func (*StatusResponse) ChargedEnergy ¶
func (g *StatusResponse) ChargedEnergy() float64
func (*StatusResponse) CurrentPower ¶
func (g *StatusResponse) CurrentPower() float64
func (*StatusResponse) Enabled ¶
func (g *StatusResponse) Enabled() bool
func (*StatusResponse) Identify ¶
func (g *StatusResponse) Identify() string
func (*StatusResponse) Status ¶
func (g *StatusResponse) Status() int
func (*StatusResponse) TotalEnergy ¶
func (g *StatusResponse) TotalEnergy() float64
type StatusResponse2 ¶
type StatusResponse2 struct { Fwv string // firmware version Car int // car status Alw bool // allow charging Amp int // current [A] Err int // error Eto uint64 // energy total Wh Psm int // phase switching Stp int // stop state Tmp int // temperature [°C] Trx int // transaction Nrg []float64 // voltage, current, power Wh float64 // energy [Wh] Cards []Card // RFID cards }
StatusResponse2 is the v2 API response
func (*StatusResponse2) ChargedEnergy ¶
func (g *StatusResponse2) ChargedEnergy() float64
func (*StatusResponse2) CurrentPower ¶
func (g *StatusResponse2) CurrentPower() float64
func (*StatusResponse2) Enabled ¶
func (g *StatusResponse2) Enabled() bool
func (*StatusResponse2) Identify ¶
func (g *StatusResponse2) Identify() string
func (*StatusResponse2) Status ¶
func (g *StatusResponse2) Status() int
func (*StatusResponse2) TotalEnergy ¶
func (g *StatusResponse2) TotalEnergy() float64
type UpdateResponse ¶
type UpdateResponse map[string]interface{}
Click to show internal directories.
Click to hide internal directories.