2020-02-24 03:01:12 +00:00
|
|
|
package lifx
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
const API_BASE_URL = "https://api.lifx.com/v1"
|
|
|
|
|
|
|
|
type (
|
|
|
|
State struct {
|
|
|
|
Power string `json:"power,omitempty"`
|
|
|
|
Color string `json:"color,omitempty"`
|
|
|
|
Brightness float64 `json:"brightness,omitempty"`
|
|
|
|
Duration float64 `json:"duration,omitempty"`
|
|
|
|
Infrared float64 `json:"infrared,omitempty"`
|
|
|
|
Fast bool `json:"fast,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
Session struct {
|
|
|
|
BaseUrl string
|
|
|
|
token string
|
|
|
|
Client *http.Client
|
|
|
|
}
|
2020-02-25 06:41:29 +00:00
|
|
|
|
|
|
|
Results struct {
|
|
|
|
Results []Result `json:results`
|
|
|
|
}
|
|
|
|
|
|
|
|
Result struct {
|
|
|
|
ID string `json:"id"`
|
|
|
|
Label string `json:"label"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
}
|
2020-02-24 03:01:12 +00:00
|
|
|
)
|