aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin Guarino <collin.guarino@gmail.com>2016-02-27 13:12:59 -0500
committerCollin Guarino <collin.guarino@gmail.com>2016-02-27 13:12:59 -0500
commit76d36f528ea622a66b3e65991082fd53120737ee (patch)
treef03b5b5465aa86f93ea5258b86bd82af0d30cd4c
parent024cad670bbe1cdefaf184395a4acf0a21fe4ccd (diff)
Fixed example code to reflect new login system.
-rw-r--r--README.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/README.md b/README.md
index f092bd7..4accd13 100644
--- a/README.md
+++ b/README.md
@@ -17,8 +17,12 @@ import (
)
func main() {
- bridge, _ := hue.NewBridge("192.168.1.128")
- bridge.Login("new_user")
+ // It is recommended that you save the username from bridge.CreateUser
+ // so you don't have to press the link button every time and re-auth.
+ // When CreateUser is called it will print the generated user token.
+ bridge, _ := hue.FindBridge()
+ username, _ := bridge.CreateUser("someusernamehere")
+ bridge.Login(username)
lights, _ := bridge.GetAllLights()
for _, light := range lights {