Documentation ¶
Index ¶
- type ApiResponse
- type Connection
- func (c *Connection) CurrentPower() (float64, error)
- func (c *Connection) Currents() (float64, float64, float64, error)
- func (c *Connection) Enable(enable bool) error
- func (c *Connection) Enabled() (bool, error)
- func (c *Connection) TotalEnergy() (float64, error)
- func (c *Connection) Voltages() (float64, float64, float64, error)
- type DataResponse
- type StateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiResponse ¶
type ApiResponse struct { ProductType string `json:"product_type"` ApiVersion string `json:"api_version"` }
ApiResponse returns allows you to get basic information from the HomeWizard Energy Socket https://homewizard-energy-api.readthedocs.io/endpoints.html#basic-information-api
type Connection ¶
type Connection struct { *request.Helper ProductType string // contains filtered or unexported fields }
Connection is the homewizard connection
func NewConnection ¶
NewConnection creates a homewizard connection
func (*Connection) CurrentPower ¶
func (c *Connection) CurrentPower() (float64, error)
CurrentPower implements the api.Meter interface
func (*Connection) Currents ¶
func (c *Connection) Currents() (float64, float64, float64, error)
Currents implements the api.PhaseCurrents interface
func (*Connection) Enable ¶
func (c *Connection) Enable(enable bool) error
Enable implements the api.Charger interface
func (*Connection) Enabled ¶
func (c *Connection) Enabled() (bool, error)
Enabled implements the api.Charger interface
func (*Connection) TotalEnergy ¶
func (c *Connection) TotalEnergy() (float64, error)
TotalEnergy implements the api.MeterEnergy interface
type DataResponse ¶
type DataResponse struct { ActivePowerW float64 `json:"active_power_w"` TotalPowerImportT1kWh float64 `json:"total_power_import_t1_kwh"` TotalPowerImportT2kWh float64 `json:"total_power_import_t2_kwh"` TotalPowerImportT3kWh float64 `json:"total_power_import_t3_kwh"` TotalPowerImportT4kWh float64 `json:"total_power_import_t4_kwh"` TotalPowerExportT1kWh float64 `json:"total_power_export_t1_kwh"` TotalPowerExportT2kWh float64 `json:"total_power_export_t2_kwh"` TotalPowerExportT3kWh float64 `json:"total_power_export_t3_kwh"` TotalPowerExportT4kWh float64 `json:"total_power_export_t4_kwh"` ActiveCurrentL1A float64 `json:"active_current_l1_a"` ActiveCurrentL2A float64 `json:"active_current_l2_a"` ActiveCurrentL3A float64 `json:"active_current_l3_a"` ActiveVoltageL1V float64 `json:"active_voltage_l1_v"` ActiveVoltageL2V float64 `json:"active_voltage_l2_v"` ActiveVoltageL3V float64 `json:"active_voltage_l3_v"` }
DataResponse returns the most recent measurements from the HomeWizard device https://homewizard-energy-api.readthedocs.io/endpoints.html#state-api-v1-state
type StateResponse ¶
type StateResponse struct {
PowerOn bool `json:"power_on"`
}
StateResponse returns the actual state of the HomeWizard Energy Socket https://homewizard-energy-api.readthedocs.io/endpoints.html#recent-measurement-api-v1-data