Documentation
¶
Index ¶
- type Circuit
- type CircuitEnergy
- type CircuitPower
- type Emporia
- func (e *Emporia) FileExists(name string) bool
- func (e *Emporia) GetCustomerDevices(token *string) (err error)
- func (e *Emporia) GetDayEnergy(token *string) (ce []CircuitEnergy, err error)
- func (e *Emporia) GetLogin() (token *string, err error)
- func (e *Emporia) GetModifiedTime(filename string) (*time.Time, error)
- func (e *Emporia) GetPower(token *string) (cp []CircuitPower, err error)
- func (e *Emporia) LocalTime() (*time.Time, error)
- func (e *Emporia) ReadStringFromFile(filename string) (string, error)
- func (e *Emporia) WriteValueToFile(filename string, value string) error
- type EnergyInput
- type EnergyOutput
- type PowerInput
- type PowerOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CircuitEnergy ¶
type CircuitPower ¶
type Emporia ¶
type Emporia struct { RootTempDir string Timezone string Username string Password string ClientID string UserPoolID string DeviceGID int Circuits []Circuit `yaml:"circuits"` }
Emporia models components needed.
func (*Emporia) FileExists ¶
FileExists returns true if a filepath exists.
func (*Emporia) GetCustomerDevices ¶
TODO: Parse the response out.
func (*Emporia) GetDayEnergy ¶
func (e *Emporia) GetDayEnergy(token *string) (ce []CircuitEnergy, err error)
func (*Emporia) GetModifiedTime ¶
GetModifiedTime reads when the filename was last modified to see if the file contains today's max/min. On midnight, this will be yesterday and the file removed for the new days recordings.
func (*Emporia) ReadStringFromFile ¶
ReadStringFromFile reads a value from filename.
type EnergyInput ¶
type EnergyInput struct { DeviceGID int Channel int Start string End string Scale string Unit string }
EnergyInput is required to get energy values.
type EnergyOutput ¶
type EnergyOutput struct {
UsageList []float64 `json:"usageList"`
}
EnergyOutput models energy values returned.
type PowerInput ¶
PowerInput is required to get power values.
type PowerOutput ¶
type PowerOutput struct { DeviceListUsage struct { Devices []struct { DeviceGID int `json:"deviceGid"` ChannelUsages []struct { Name string `json:"name"` Usage float64 `json:"usage"` } `json:"channelUsages"` } `json:"devices"` } `json:"deviceListUsages"` }
PowerOutput models power values returned.
Click to show internal directories.
Click to hide internal directories.