aboutsummaryrefslogtreecommitdiff
path: root/scene_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'scene_test.go')
-rw-r--r--scene_test.go35
1 files changed, 22 insertions, 13 deletions
diff --git a/scene_test.go b/scene_test.go
index 1eff2ac..ba0d952 100644
--- a/scene_test.go
+++ b/scene_test.go
@@ -8,26 +8,35 @@
package hue
import (
+ "github.com/collinux/GoHue"
"testing"
- //"fmt"
)
func TestGetAllScenes(t *testing.T) {
- bridge, _ := NewBridge("192.168.1.128")
+ bridges, err := hue.FindBridges()
+ if err != nil {
+ t.Fatal(err)
+ }
+ bridge := bridges[0]
bridge.Login("427de8bd6d49f149c8398e4fc08f")
- scenes, _ := bridge.GetAllScenes()
- // for scene := range scenes {
- // fmt.Println("SCENE: ", scenes[scene])
- // }
-
- individual, _ := bridge.GetScene(scenes[0].ID)
- _ = individual
- //fmt.Println("Individual scene: ", individual)
+ scenes, err := bridge.GetAllScenes()
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Log(scenes)
}
+// TODO not functional
func TestCreateScene(t *testing.T) {
- bridge, _ := NewBridge("192.168.1.128")
+ bridges, err := hue.FindBridges()
+ if err != nil {
+ t.Fatal(err)
+ }
+ bridge := bridges[0]
bridge.Login("427de8bd6d49f149c8398e4fc08f")
- scene := Scene{Lights: []string{"1", "2"}}
- _ = bridge.CreateScene(scene)
+ scene := hue.Scene{Name: "Testing", Lights: []string{"1", "2"}}
+ err = bridge.CreateScene(scene)
+ if err != nil {
+ t.Fatal(err)
+ }
}