Documentation ¶
Overview ¶
netswitch control.
The NetSwitches have Relays that must be in sync with our system. For example when a NetSwitch is plugged in, the relay must go into the correct position. The mfi Switches are by default switched on and need to turn off after being plugged in.
Index ¶
- Constants
- type MfiSensor
- type MfiSwitch
- type NetSwitch
- func (ns *NetSwitch) ApplyConfig(updates chan<- string, xmppClient *xmpp.Xmpp, userId int64) (err error)
- func (ns *NetSwitch) FetchNetswitchStatus() (relayState string, current float64, err error)
- func (ns *NetSwitch) SetOn(on bool) (err error)
- func (ns *NetSwitch) String() string
- func (ns *NetSwitch) UrlOff() string
- func (ns *NetSwitch) UrlOn() string
Constants ¶
View Source
const NETSWITCH_TYPE_MFI = "mfi"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MfiSensor ¶
type MfiSensor struct { Output int `json:"output"` Power float64 `json:"power"` Energy float64 `json:"energy"` Enabled float64 `json:"enabled"` Current float64 `json:"current"` Voltage float64 `json:"voltage"` PowerFactor float64 `json:"powerfactor"` Relay int `json:"relay"` Lock int `json:"lock"` }
type NetSwitch ¶
type NetSwitch struct { On bool `json:"-"` // We're using this without Beego ORM attached Id int64 NetswitchUrlOn string NetswitchUrlOff string NetswitchHost string NetswitchSensorPort int NetswitchType string // contains filtered or unexported fields }
func (*NetSwitch) ApplyConfig ¶
func (*NetSwitch) FetchNetswitchStatus ¶
Click to show internal directories.
Click to hide internal directories.