Documentation
¶
Index ¶
- type CasetaDevice
- type CasetaInventory
- type Command
- type Inventory
- type Lutron
- func (l *Lutron) Connect() error
- func (l *Lutron) Disconnect() error
- func (l *Lutron) NameFromId(i int) (string, error)
- func (l *Lutron) Send(msg string) error
- func (l *Lutron) SendCommand(c *LutronMsg) (resp string, err error)
- func (l *Lutron) SetById(id int, level float64) error
- func (l *Lutron) SetByName(name string, level float64) error
- func (l *Lutron) Watch(c *LutronMsg) (responses chan *LutronMsg, stop chan bool)
- type LutronMsg
- type MsgType
- type ResponseWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CasetaInventory ¶
type CasetaInventory struct { LIPIDList struct { Devices []struct { ID int `json:"ID"` Name string `json:"Name"` Buttons []struct { Name string `json:"Name"` Number int `json:"Number"` } `json:"Buttons"` Area struct { Name string `json:"Name"` } `json:"Area"` } `json:"Devices"` Zones []struct { ID int `json:"ID"` Name string `json:"Name"` Area struct { Name string `json:"Name"` } `json:"Area"` } `json:"Zones"` } `json:"LIPIdList"` }
Raw parsed json from the caseta app via https://mholt.github.io/json-to-go/
func NewCasetaInventory ¶
func NewCasetaInventory(path string) *CasetaInventory
func (*CasetaInventory) Get ¶
func (i *CasetaInventory) Get(id int) (CasetaDevice, error)
func (*CasetaInventory) IdFromName ¶
func (i *CasetaInventory) IdFromName(n string) (id int, err error)
func (*CasetaInventory) NameFromId ¶
func (i *CasetaInventory) NameFromId(id int) (name string, err error)
type Lutron ¶
type Lutron struct { Port string Username string Password string // contains filtered or unexported fields }
func (*Lutron) Disconnect ¶
type LutronMsg ¶
type LutronMsg struct { // the lutron component number Id int Name string Value float64 // duration in seconds for a set action // TODO parse > 60 seconds into string "M:SS" Fade float64 // the action to take with the command, Get, Set, Watch, Default: Get Type MsgType // the integration command type - Output, Device Cmd Command // usually the button press Action int // in Unix nanos format Timestamp int64 }
type ResponseWatcher ¶
type ResponseWatcher struct { Responses chan *LutronMsg // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.