Documentation
¶
Index ¶
- Variables
- type Arp
- type Config
- type Hab
- type Light
- type Milight
- func (m *Milight) GetBrightness() (n int, err error)
- func (m *Milight) GetColor() (r, g, b int, err error)
- func (m *Milight) GetWarmth() (n int, err error)
- func (m *Milight) Off() error
- func (m *Milight) On() error
- func (m *Milight) SetBrightness(n int) error
- func (m *Milight) SetColor(r, g, b int) error
- func (m *Milight) SetWarmth(n int) error
- type Presence
- type ThingConf
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ListenAddr string `yaml:"listen"` //HTTP address to listen on, default ":80"
Things []ThingConf `yaml:"things"` //List of things we want to monitor/control
}
Main config object
type Hab ¶
type Hab struct {
// contains filtered or unexported fields
}
The main instance of the hab
type Light ¶
type Light interface {
On() error //Turn on light
Off() error //Turn on light
SetBrightness(n int) error //Set brightness 1 - 10
SetWarmth(n int) error //Set warmth 1 - 10
SetColor(r, g, b int) error //Set color
GetBrightness() (n int, err error) //Get current brightness 1 - 10
GetWarmth() (n int, err error) //Get current warmth 1 - 10
GetColor() (r, g, b int, err error) //Get current color
}
type Milight ¶
type Milight struct {
// contains filtered or unexported fields
}
Milight represents a single light bulb zone managed using wifi controller box
func (*Milight) GetBrightness ¶
func (*Milight) SetBrightness ¶
type ThingConf ¶
type ThingConf struct {
Name string `yaml:"name"` //Friendly name for human convienence
Type string `yaml:"type"` //What type of device is this?
Module string `yaml:"module"` //Which Module to use
Args map[string]string `yaml:"args"` //Arbitary key-value data which the relavent module can understand
}
Thing is something that can be controlled and/or queried by the hab
Source Files
¶
Click to show internal directories.
Click to hide internal directories.