Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BtnPressEvt ¶
BtnPressEvt is fired when a button is pressed, not this is only the press action not also the release, this is not a click
func (BtnPressEvt) String ¶
func (e BtnPressEvt) String() string
type BtnReleaseEvt ¶
BtnReleaseEvt is fired when a button is released
func (BtnReleaseEvt) String ¶
func (e BtnReleaseEvt) String() string
type Device ¶
type Device interface {
// SetLevel sets the device to the specified level
SetLevel(level float32, zoneAddress string, w io.Writer) error
// RequestLevel requests the current level of the specified zone. You will have to
// watch the devices stream to parse the response that comes back. It is async so
// it may take time depending on how fast the lutron hub responds
RequestLevel(zoneAddr string, w io.Writer) error
// ButtonPress sends a button press command
ButtonPress(devAddr, btnAddr string, w io.Writer) error
// ButtonRelease sends a button release command
ButtonRelease(devAddr, btnAddr string, w io.Writer) error
// Ping sends a ping request e.g. #PING, callers can then wait for the
// ping response e.g. ~PING, if nothing returns after a while you know something
// is wrong with the connection you have to the hub
Ping(w net.Conn, wait time.Duration) error
Stream(r io.Reader, handler func(Event)) error
}
Device represents an interface to a Lutron device. Different Lutron devices may send different commands, so this interface is used to abstract that from the callers
func DeviceFromModelNumber ¶
DeviceFromModelNumber returns a Lutron device, based on the modelNumber parameter
type UnknownEvt ¶
type UnknownEvt struct {
Msg string
}
UnknownEvt is an event which we don't parse into a concrete type, can inspect the Msg field
func (UnknownEvt) String ¶
func (e UnknownEvt) String() string
type ZoneLevelEvt ¶
ZoneLevelEvt is when the system reports a zones current level
func (ZoneLevelEvt) String ¶
func (e ZoneLevelEvt) String() string
Click to show internal directories.
Click to hide internal directories.