Documentation
¶
Index ¶
- type Controller
- func (c *Controller) Address() string
- func (c *Controller) Close() error
- func (c *Controller) Model() string
- func (c *Controller) Serial() string
- func (c *Controller) SetBrightness(b int) error
- func (c *Controller) SetOn(on bool) error
- func (c *Controller) SetRGB(r, g, b int) error
- func (c *Controller) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
A Controller is a Lead Energy WiFi LED controller.
func Discover ¶
func Discover(network string) ([]*Controller, error)
Discover performs network discovery on a given LAN segment and returns a list of discovered LED controllers, or an error. The network should be given in CIDR form, i.e. 172.16.32.0/24. The discovery mechanism is based on IPv4 broadcasts so will only function on directly connected interfaces with an IPv4 address.
func NewController ¶
func NewController(address string) *Controller
NewController returns a new controller object for the given address. See also Discover() to return a list of Controllers on a given LAN segment.
func (*Controller) Address ¶
func (c *Controller) Address() string
Address returns the address (ip:port) of the LED controller.
func (*Controller) Close ¶
func (c *Controller) Close() error
Close closes the connection to the LED controller.
func (*Controller) Model ¶
func (c *Controller) Model() string
Model returns the model number for the WiFi controller. This is set only if the Controller is created via Discover().
func (*Controller) Serial ¶
func (c *Controller) Serial() string
Serial returns the serial number for the WiFi controller. This is set only if the Controller is created via Discover().
func (*Controller) SetBrightness ¶
func (c *Controller) SetBrightness(b int) error
SetBrightness sets the brightness factor. The range of valid values is 0 through 63 inclusive.
func (*Controller) SetOn ¶
func (c *Controller) SetOn(on bool) error
func (*Controller) SetRGB ¶
func (c *Controller) SetRGB(r, g, b int) error
SetRGB sets the color. The range of valid values for r, g and b is 0 through 255, inclusive.
func (*Controller) String ¶
func (c *Controller) String() string