Documentation ¶
Index ¶
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 ¶
func NewConnection(uri string, cache time.Duration) (*Connection, error)
NewConnection creates a homewizard connection
func (*Connection) CurrentPower ¶
func (c *Connection) CurrentPower() (float64, error)
CurrentPower implements the api.Meter 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 reads the homewizard switch state true=on/false=off
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"` }
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