lead

package module
v0.0.0-...-3bf6aa4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 7 Imported by: 0

README

lead

Package lead implements a controller for Lead Energy wireless LED strips. It supports setting color and brightness.

License

MIT

Documentation

Index

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

Directories

Path Synopsis
cmd
lead command
sunrise command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL