Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // States available states of lights States = map[string]map[string]interface{}{ "off": { "on": false, "transitiontime": 30, }, "long_off": { "on": false, "transitiontime": 300, }, "on": { "on": true, "transitiontime": 30, "sat": 0, "bri": 254, }, "dimmed": { "on": true, "transitiontime": 30, "sat": 0, "bri": 0, }, "long_on": { "on": true, "transitiontime": 3000, "sat": 0, "bri": 254, }, } )
Functions ¶
This section is empty.
Types ¶
type APIScene ¶
type APIScene struct {
Name string `json:"name,omitempty"`
Lights []string `json:"lights,omitempty"`
Lightstates map[string]map[string]interface{} `json:"lightstates,omitempty"`
Recycle bool `json:"recycle"`
}
APIScene describe scene as from Hue API
type APISchedule ¶
type APISchedule struct {
Name string `json:"name,omitempty"`
Localtime string `json:"localtime,omitempty"`
Command Action `json:"command,omitempty"`
Status string `json:"status,omitempty"`
}
APISchedule describe schedule as from Hue API
type Action ¶
type Action struct {
Address string `json:"address,omitempty"`
Body map[string]interface{} `json:"body,omitempty"`
Method string `json:"method,omitempty"`
}
Action description
type App ¶
type App interface {
Handle(*http.Request) (model.Message, int)
Data() map[string]interface{}
Start()
}
App stores informations and secret of API
func New ¶
func New(config Config, registerer prometheus.Registerer) (App, error)
New creates new App from Config
type Condition ¶
type Condition struct {
Address string `json:"address,omitempty"`
Operator string `json:"operator,omitempty"`
Value string `json:"value,omitempty"`
}
Condition description
type Group ¶
type Group struct {
Name string `json:"name,omitempty"`
Tap bool `json:"tap,omitempty"`
Lights []string `json:"lights,omitempty"`
State groupState `json:"state,omitempty"`
}
Group description
type Light ¶
type Light struct {
Type string `json:"type,omitempty"`
State lightState `json:"state,omitempty"`
}
Light description
type Rule ¶
type Rule struct {
ID string `json:"-"`
Status string `json:"status,omitempty"`
Name string `json:"name,omitempty"`
Actions []Action `json:"actions,omitempty"`
Conditions []Condition `json:"conditions,omitempty"`
}
Rule description
type Schedule ¶
type Schedule struct {
ID string `json:"id,omitempty"`
APISchedule
}
Schedule description
func (Schedule) FindStateName ¶
FindStateName finds matching state's name
func (Schedule) FormatLocalTime ¶
FormatLocalTime formats local time of schedules to human readable version
type ScheduleConfig ¶
ScheduleConfig configuration (made simple)
Click to show internal directories.
Click to hide internal directories.