diff options
author | Collin Guarino <collin.guarino@gmail.com> | 2016-02-06 12:09:34 -0500 |
---|---|---|
committer | Collin Guarino <collin.guarino@gmail.com> | 2016-02-06 12:09:34 -0500 |
commit | a00d2ad0302638e3e2a6bd9f3435fab2cde66627 (patch) | |
tree | 71df1f3cd1e82862a7f2b4c0895e1302d294dacc /light_test.go | |
parent | dd56e79fa26cc8caca596f4de4a0099b375c94d4 (diff) |
Improved visual testing for light state SetLightState.
Diffstat (limited to 'light_test.go')
-rw-r--r-- | light_test.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/light_test.go b/light_test.go index cf8ce93..a1e5f61 100644 --- a/light_test.go +++ b/light_test.go @@ -3,6 +3,7 @@ package hue import ( "testing" "fmt" + "time" ) func TestGetAllLights(t *testing.T) { @@ -20,7 +21,14 @@ func TestSetLightState(t *testing.T) { bridge := NewBridge("192.168.1.128", "319b36233bd2328f3e40731b23479207") lights, _ := GetAllLights(bridge) selectedLight := lights[0] - newState := LightState{On: true,} //On: false, *XY: [2]float32{5.0, 5.0}, - //fmt.Println("\n\nSTATE: ", newState) + + // Turn light on, off, on again + newState := LightState{On: true,} + SetLightState(bridge, selectedLight.Index, newState) + time.Sleep(time.Second) + newState = LightState{On: false,} + SetLightState(bridge, selectedLight.Index, newState) + time.Sleep(time.Second) + newState = LightState{On: true,} SetLightState(bridge, selectedLight.Index, newState) } |