Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient creates a new client with the given API key, client ID and default base URL
func NewClientWithBaseURL ¶
NewClientWithBaseURL creates a new client with the given API key and base URL
func (*Client) FetchRealtimeData ¶
func (c *Client) FetchRealtimeData(thingID string) (RealtimeDataResponse, error)
FetchRealtimeData fetches the realtime data for the thing with the given ID
type RealtimeData ¶
type RealtimeDataRequest ¶
type RealtimeDataRequest struct {
RealtimeData RealtimeData `json:"realtimeData"`
}
type RealtimeDataResponse ¶
type RealtimeDataResponse struct { RealtimeData struct { Params struct { Value []map[string]struct { EnergyDischargingTotal float64 `json:"energyDischargingTotal"` PowerExporting float64 `json:"powerExporting"` EnergyExportingTotal float64 `json:"energyExportingTotal"` EnergyDischarging float64 `json:"energyDischarging"` BatteryCycletime int `json:"batteryCycletime"` LastUpdate time.Time `json:"lastUpdate"` EnergyGenerating float64 `json:"energyGenerating"` EnergyAutoconsumingTotal float64 `json:"energyAutoconsumingTotal"` EnergyImporting float64 `json:"energyImporting"` EnergyCharging float64 `json:"energyCharging"` PowerImporting float64 `json:"powerImporting"` EnergyChargingTotal float64 `json:"energyChargingTotal"` EnergyConsumingTotal float64 `json:"energyConsumingTotal"` EnergyAutoconsuming float64 `json:"energyAutoconsuming"` PowerConsuming float64 `json:"powerConsuming"` EnergyConsuming float64 `json:"energyConsuming"` PowerGenerating float64 `json:"powerGenerating"` EnergyImportingTotal float64 `json:"energyImportingTotal"` EnergyExporting float64 `json:"energyExporting"` BatterySoC int `json:"batterySoC"` ThingFind string `json:"thingFind"` PowerAutoconsuming float64 `json:"powerAutoconsuming"` PowerCharging float64 `json:"powerCharging"` EnergyGeneratingTotal float64 `json:"energyGeneratingTotal"` PowerDischarging float64 `json:"powerDischarging"` } `json:"value"` } `json:"params"` Success bool `json:"success"` } `json:"realtimeData"` }
Click to show internal directories.
Click to hide internal directories.