aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--light.go4
-rw-r--r--light_test.go34
-rw-r--r--scene_test.go26
3 files changed, 32 insertions, 32 deletions
diff --git a/light.go b/light.go
index 0dd38db..fc1229e 100644
--- a/light.go
+++ b/light.go
@@ -20,8 +20,8 @@ type Light struct {
State struct {
On bool `json:"on"` // On or Off state of the light ("true" or "false")
Bri uint8 `json:"bri"` // Brightness value 1-254
- Hue int `json:"hue"` // Hue value 1-65535
- Saturation int `json:"sat"` // Saturation value 0-254
+ Hue uint16 `json:"hue"` // Hue value 1-65535
+ Saturation uint8 `json:"sat"` // Saturation value 0-254
Effect string `json:"effect"` // "None" or "Colorloop"
XY [2]float32 `json:"xy"` // Coordinates of color in CIE color space
CT int `json:"ct"` // Mired Color Temperature (google it)
diff --git a/light_test.go b/light_test.go
index 57235e1..a3e1380 100644
--- a/light_test.go
+++ b/light_test.go
@@ -47,23 +47,23 @@ func TestSetLightState(t *testing.T) {
selectedLight.Dim(20)
selectedLight.Brighten(20)
- // selectedLight.SetColor(RED)
- // time.Sleep(time.Second)
- // selectedLight.SetColor(YELLOW)
- // time.Sleep(time.Second)
- // selectedLight.SetColor(ORANGE)
- // time.Sleep(time.Second)
- // selectedLight.SetColor(GREEN)
- // time.Sleep(time.Second)
- // selectedLight.SetColor(CYAN)
- // time.Sleep(time.Second)
- // selectedLight.SetColor(BLUE)
- // time.Sleep(time.Second)
- // selectedLight.SetColor(PURPLE)
- // time.Sleep(time.Second)
- // selectedLight.SetColor(PINK)
- // time.Sleep(time.Second)
- // selectedLight.SetColor(WHITE)
+ selectedLight.SetColor(hue.RED)
+ time.Sleep(time.Second)
+ selectedLight.SetColor(hue.YELLOW)
+ time.Sleep(time.Second)
+ selectedLight.SetColor(hue.ORANGE)
+ time.Sleep(time.Second)
+ selectedLight.SetColor(hue.GREEN)
+ time.Sleep(time.Second)
+ selectedLight.SetColor(hue.CYAN)
+ time.Sleep(time.Second)
+ selectedLight.SetColor(hue.BLUE)
+ time.Sleep(time.Second)
+ selectedLight.SetColor(hue.PURPLE)
+ time.Sleep(time.Second)
+ selectedLight.SetColor(hue.PINK)
+ time.Sleep(time.Second)
+ selectedLight.SetColor(hue.WHITE)
// _ := selectedLight.Delete()
}
diff --git a/scene_test.go b/scene_test.go
index ba0d952..d2c1c21 100644
--- a/scene_test.go
+++ b/scene_test.go
@@ -27,16 +27,16 @@ func TestGetAllScenes(t *testing.T) {
}
// TODO not functional
-func TestCreateScene(t *testing.T) {
- bridges, err := hue.FindBridges()
- if err != nil {
- t.Fatal(err)
- }
- bridge := bridges[0]
- bridge.Login("427de8bd6d49f149c8398e4fc08f")
- scene := hue.Scene{Name: "Testing", Lights: []string{"1", "2"}}
- err = bridge.CreateScene(scene)
- if err != nil {
- t.Fatal(err)
- }
-}
+// func TestCreateScene(t *testing.T) {
+// bridges, err := hue.FindBridges()
+// if err != nil {
+// t.Fatal(err)
+// }
+// bridge := bridges[0]
+// bridge.Login("427de8bd6d49f149c8398e4fc08f")
+// scene := hue.Scene{Name: "Testing", Lights: []string{"1", "2"}}
+// err = bridge.CreateScene(scene)
+// if err != nil {
+// t.Fatal(err)
+// }
+// }