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
}
Controller is the controller for the lights
func NewController ¶
func NewController(i2cBus string, boards []uint8) (*Controller, error)
NewController returns a new controller on the i2c bus
func (*Controller) Boards ¶
func (c *Controller) Boards() []uint8
func (*Controller) IsOn ¶
func (c *Controller) IsOn(addr internal.LightAddress) (bool, error)
IsOn returns true when light is on or false in the oposite case
func (*Controller) Reset ¶
func (c *Controller) Reset() error
func (*Controller) Set ¶
func (c *Controller) Set(addr internal.LightAddress, isON bool) (err error)
On turns on/off the light
func (*Controller) Subscribe ¶
func (c *Controller) Subscribe(ch chan<- internal.PinState)
Subscribe returns a channel to subscribe for the light changes
type ControllerI ¶
type TestController ¶
type TestController struct {
// contains filtered or unexported fields
}
TestController is a fake implementation for development without real board TestController always returns no error for the set command
func NewTestController ¶
func NewTestController(boards []uint8) *TestController
func (*TestController) Boards ¶
func (c *TestController) Boards() []uint8
func (*TestController) IsOn ¶
func (c *TestController) IsOn(addr internal.LightAddress) (bool, error)
func (*TestController) Reset ¶
func (c *TestController) Reset() error
func (*TestController) Set ¶
func (c *TestController) Set(addr internal.LightAddress, isON bool) error
func (*TestController) Subscribe ¶
func (c *TestController) Subscribe(ch chan<- internal.PinState)
Click to show internal directories.
Click to hide internal directories.