aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin Guarino <collin.guarino@gmail.com>2016-02-18 23:44:45 -0500
committerCollin Guarino <collin.guarino@gmail.com>2016-02-18 23:44:45 -0500
commit6a4c4aef9b6fecaf568fe255fe6a588aff396630 (patch)
tree8b53ba1ead3945cba489bd54f3a2de247f96fff9
parentb2078fa657c1d205c91ac930be3845ff1f9840c1 (diff)
Added usage code examples in readme.
-rw-r--r--README.md25
1 files changed, 23 insertions, 2 deletions
diff --git a/README.md b/README.md
index d530bd3..0a604f1 100644
--- a/README.md
+++ b/README.md
@@ -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