aboutsummaryrefslogtreecommitdiff
path: root/light_test.go
diff options
context:
space:
mode:
authorCollin Guarino <collin.guarino@gmail.com>2016-02-07 17:04:51 -0500
committerCollin Guarino <collin.guarino@gmail.com>2016-02-07 17:04:51 -0500
commit3b569742f3826ff0119d2a91669933863a3a428d (patch)
treef2d39271ef9bbcfac350554867bdbd25a886c894 /light_test.go
parent910ec0556232d926d76a15301a7667131f936f52 (diff)
Configuring On/Off functions for lights.
Diffstat (limited to 'light_test.go')
-rw-r--r--light_test.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/light_test.go b/light_test.go
index a1e5f61..0a63bf8 100644
--- a/light_test.go
+++ b/light_test.go
@@ -22,13 +22,9 @@ func TestSetLightState(t *testing.T) {
lights, _ := GetAllLights(bridge)
selectedLight := lights[0]
- // Turn light on, off, on again
- newState := LightState{On: true,}
- SetLightState(bridge, selectedLight.Index, newState)
+ selectedLight.TurnOn()
time.Sleep(time.Second)
- newState = LightState{On: false,}
- SetLightState(bridge, selectedLight.Index, newState)
+ selectedLight.TurnOf()
time.Sleep(time.Second)
- newState = LightState{On: true,}
- SetLightState(bridge, selectedLight.Index, newState)
+ selectedLight.TurnOn()
}