Documentation ¶
Index ¶
- Constants
- func Fade(unit Unit, ch Channel, from, to float64, dur time.Duration) []byte
- func FadeWithEffect(unit Unit, ch Channel, from, to float64, dur time.Duration, effect Effect) []byte
- func Heartbeat() []byte
- func MaskedFade(unit Unit, mask *Mask, from, to float64, dur time.Duration) []byte
- func MaskedOn(unit Unit, mask *Mask) []byte
- func MaskedSetBrightness(unit Unit, mask *Mask, val float64) []byte
- func MaskedSetEffect(unit Unit, mask *Mask, effect Effect) []byte
- func On(unit Unit, ch Channel) []byte
- func SetBrightness(unit Unit, ch Channel, val float64) []byte
- func SetEffect(unit Unit, ch Channel, effect Effect) []byte
- type Channel
- type Controller
- func (c Controller) Fade(ch Channel, from, to float64, dur time.Duration) (n int, err error)
- func (c Controller) FadeWithEffect(ch Channel, from, to float64, dur time.Duration, effect Effect) (n int, err error)
- func (c Controller) Heartbeat() (n int, err error)
- func (c Controller) MaskedFade(mask *Mask, from, to float64, dur time.Duration) (n int, err error)
- func (c Controller) MaskedOn(mask *Mask) (n int, err error)
- func (c Controller) MaskedSetBrightness(mask *Mask, val float64) (n int, err error)
- func (c Controller) MaskedSetEffect(mask *Mask, effect Effect) (n int, err error)
- func (c Controller) On(ch Channel) (n int, err error)
- func (c Controller) SetBrightness(ch Channel, val float64) (n int, err error)
- func (c Controller) SetEffect(ch Channel, effect Effect) (n int, err error)
- type Effect
- type Mask
- type Unit
Constants ¶
const DefaultHeartbeatRate = time.Millisecond * 500
DefaultHeartbeatRate represents the timing rate at which LOR vendor software sends a heartbeat to the hardware. This has been determined by monitoring the serial port connection.
Variables ¶
This section is empty.
Functions ¶
func FadeWithEffect ¶ added in v0.3.0
func MaskedFade ¶ added in v0.3.0
func MaskedSetBrightness ¶ added in v0.3.0
func MaskedSetEffect ¶ added in v0.3.0
Types ¶
type Channel ¶
type Channel byte
Channel represents a unique, addressable channel belonging to a given Controller's namespace.
type Controller ¶
Controller represents a LOR unit. ID is the unit's network ID as externally configured.
func NewController ¶ added in v0.3.0
func NewController(unit Unit, writer io.Writer) *Controller
NewController returns a new Controller instance using the given io.Writer.
func (Controller) Fade ¶
Fade writes a command payload to fade a channel's brightness from and to the specified values within the specified duration.
func (Controller) FadeWithEffect ¶
func (c Controller) FadeWithEffect(ch Channel, from, to float64, dur time.Duration, effect Effect) (n int, err error)
FadeWithEffect writes a command payload to fade a channel's brightness from and to the specified values within the specified duration. The effect will be applied alongside the fade effect.
func (Controller) Heartbeat ¶ added in v0.3.0
func (c Controller) Heartbeat() (n int, err error)
Heartbeat writes a heartbeat payload to the currently open serial port.
func (Controller) MaskedFade ¶ added in v0.3.0
MaskedFade writes a multi command payload to fade all masked channels brightness from and to the specified values within the specified duration.
func (Controller) MaskedOn ¶ added in v0.3.0
func (c Controller) MaskedOn(mask *Mask) (n int, err error)
MaskedOn writes a multi command payload to set all masked channels to 100% brightness. This saves 1 byte over a MaskedSetBrightness call.
func (Controller) MaskedSetBrightness ¶ added in v0.3.0
func (c Controller) MaskedSetBrightness(mask *Mask, val float64) (n int, err error)
MaskedSetBrightness writes a multi command payload to set all masked channels brightness to the specified value.
func (Controller) MaskedSetEffect ¶ added in v0.3.0
func (c Controller) MaskedSetEffect(mask *Mask, effect Effect) (n int, err error)
MaskedSetEffect writes a multi command payload to set all masked channels active effect.
func (Controller) On ¶
func (c Controller) On(ch Channel) (n int, err error)
On writes a command payload to set the channel to 100% brightness. This saves 1 byte over a SetBrightness call.
func (Controller) SetBrightness ¶
func (c Controller) SetBrightness(ch Channel, val float64) (n int, err error)
SetBrightness writes a command payload to set the channel's brightness to the specified value.