diff options
author | Collin Guarino <collin.guarino@gmail.com> | 2016-02-18 23:44:45 -0500 |
---|---|---|
committer | Collin Guarino <collin.guarino@gmail.com> | 2016-02-18 23:44:45 -0500 |
commit | 6a4c4aef9b6fecaf568fe255fe6a588aff396630 (patch) | |
tree | 8b53ba1ead3945cba489bd54f3a2de247f96fff9 | |
parent | b2078fa657c1d205c91ac930be3845ff1f9840c1 (diff) |
Added usage code examples in readme.
-rw-r--r-- | README.md | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -8,9 +8,30 @@ go get github.com/collinux/gohue ## Usage ``` -import "github.com/collinux/gohue" +package main -EXAMPLES COMING SOON +import ( + "github.com/collinux/gohue" +) + +func main() { + bridge, _ := hue.NewBridge("192.168.1.128") + bridge.Login("new_user") + + lights, _ := bridge.GetAllLights() + for _, light := range lights { + light.On() + light.ColorLoop(true) + } + + nightstandLight, _ := bridge.GetLightByName("Nightstand") + nightstandLight.Blink(5) + nightstandLight.SetName("Bedroom Lamp") + + for _, light := range lights { + light.Off() + } +} ``` ## Features |