From a0a8f16f81b36bd700a3d08780ac6e67a9dfc8a0 Mon Sep 17 00:00:00 2001 From: Collin Guarino Date: Thu, 4 Feb 2016 14:38:39 -0500 Subject: Added index to Light struct to easily reference it from []light. --- light_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'light_test.go') diff --git a/light_test.go b/light_test.go index b1ea862..6da677d 100644 --- a/light_test.go +++ b/light_test.go @@ -16,9 +16,10 @@ func TestGetLight(t *testing.T) { } func TestSetLightState(t *testing.T) { + fmt.Println("\nTESTING LIGHT STATE:\n\n") bridge := NewBridge("192.168.1.128", "319b36233bd2328f3e40731b23479207") lights, _ := GetAllLights(bridge) - fmt.Println(lights[0].Name) - newState := LightState{On: true} - SetLightState(bridge, lights[0].UniqueID, newState) + fmt.Println("\nUNIQUE ID: ", lights[0].UniqueID) + newState := LightState{On: false} + SetLightState(bridge, lights[1].Index, newState) } -- cgit v1.2.3