From 784fcefa2add45d5f2a6ee894c9d7a9e44c375a7 Mon Sep 17 00:00:00 2001 From: Collin Guarino Date: Fri, 23 Sep 2016 17:32:42 -0400 Subject: Fixed schedule_test output --- schedule_test.go | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/schedule_test.go b/schedule_test.go index 0039c6b..f1235af 100644 --- a/schedule_test.go +++ b/schedule_test.go @@ -8,19 +8,40 @@ package hue import ( + "github.com/collinux/GoHue" "testing" ) func TestGetAllSchedules(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") - _, _ = bridge.GetAllSchedules() + schedules, err := bridge.GetAllSchedules() + if err != nil { + t.Fatal(err) + } + t.Log(schedules) } func TestGetSchedule(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") - _, _ = bridge.GetSchedule("4673980164949558") + schedules, err := bridge.GetAllSchedules() + if err != nil { + t.Fatal(err) + } + schedule, err := bridge.GetSchedule(schedules[0].ID) + if err != nil { + t.Fatal(err) + } + t.Log(schedule) } // func TestCreateSchedule(t *testing.T) { -- cgit v1.2.3