aboutsummaryrefslogtreecommitdiff
path: root/light.go
diff options
context:
space:
mode:
authorCollin Guarino <collin.guarino@gmail.com>2016-01-30 14:39:09 -0500
committerCollin Guarino <collin.guarino@gmail.com>2016-01-30 14:39:09 -0500
commitb802df3354c3ec95953d0022ba6c4132d7988cf6 (patch)
tree0177388eae9c1d95137b5b40911b6197bb374378 /light.go
parentc8327ca8d5af0a4013654f9ebb8d509c865df255 (diff)
Prepared SetLightState struct for SetState func.
Diffstat (limited to 'light.go')
-rw-r--r--light.go38
1 files changed, 28 insertions, 10 deletions
diff --git a/light.go b/light.go
index 7c0fda2..68310ee 100644
--- a/light.go
+++ b/light.go
@@ -1,3 +1,5 @@
+// http://www.developers.meethue.com/documentation/lights-api
+
package hue
import (
@@ -12,16 +14,16 @@ import (
type Light struct {
State struct {
- On bool `json:"on"`
- Bri int `json:"bri"`
- hue int `json:"hue"`
- sat int `json:"sat"`
- effect string `json:"effect"`
- xy []string `json:"xy"` // TODO: what is this?
- ct int `json:"ct"` // TODO: what is this?
- alert string `json:"alert"`
- colormode string `json:"colormode"`
- reachable bool `json:"reachable"`
+ On bool `json:"on"` // On or Off state of the light ("true" or "false")
+ Bri int `json:"bri"` // Brightness value 1-254
+ Hue int `json:"hue"` // Hue value 1-65535
+ Saturation int `json:"sat"` // Saturation value 0-254
+ Effect string `json:"effect"` //
+ XY []string `json:"xy"` // Coordinates of color in CIE color space
+ CT int `json:"ct"` // Mired Color Temperature
+ Alert string `json:"alert"`
+ ColorMode string `json:"colormode"`
+ Reachable bool `json:"reachable"`
} `json:"state"`
Type string `json:"type"`
Name string `json:"name"`
@@ -31,6 +33,22 @@ type Light struct {
SWVersion string `json:"swversion"`
}
+type SetLightState struct {
+ On bool
+ Bri uint8
+ Hue uint16
+ Sat uint8
+ XY [2]float4
+ CT uint16
+ Alert string
+ Effect string
+ TransitionTime string
+ BrightnessIncrement int // TODO: -254 to 254
+ SaturationIncrement int // TODO: -254 to 254
+ HueIncrement int // TODO: -65534 to 65534
+ CTIncrement int // TODO: -65534 to 65534
+ XYIncrement [2]float4
+}
//http://192.168.1.128/api/319b36233bd2328f3e40731b23479207/lights/