Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Discover ¶ added in v1.1.0
func Discover(options DiscoverOptions) (*[]Device, error)
Discover searches for Magic Home devices on the network
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller represents a Magic Home LED Strip Controller
func New ¶
func New(ip net.IP, port uint16) (*Controller, error)
New initializes a new Magic Home LED Strip Controller
func (*Controller) Close ¶
func (c *Controller) Close() error
Close closes the tcp connection to the LED Strip
func (*Controller) GetDeviceState ¶ added in v1.2.0
func (c *Controller) GetDeviceState() (*DeviceState, error)
GetDeviceState can be used to get information about the state of the LED Strip
func (*Controller) SetColor ¶
func (c *Controller) SetColor(color Color) error
SetColor can be used to change the color of the LED Strip
func (*Controller) SetState ¶
func (c *Controller) SetState(s State) error
SetState can be used to switch the LED Strip on (magichome.On) or off (magichome.Off)
type DeviceState ¶ added in v1.2.0
type DeviceState struct {
DeviceType uint8
State State
LedVersionNumber uint8
Mode uint8
Slowness uint8
Color Color
}
DeviceState represents the state of the device
type DiscoverOptions ¶ added in v1.1.0
DiscoverOptions are used to configure the discovering
Click to show internal directories.
Click to hide internal directories.