diff options
author | Collin Guarino <collin.guarino@gmail.com> | 2016-02-27 13:12:59 -0500 |
---|---|---|
committer | Collin Guarino <collin.guarino@gmail.com> | 2016-02-27 13:12:59 -0500 |
commit | 76d36f528ea622a66b3e65991082fd53120737ee (patch) | |
tree | f03b5b5465aa86f93ea5258b86bd82af0d30cd4c | |
parent | 024cad670bbe1cdefaf184395a4acf0a21fe4ccd (diff) |
Fixed example code to reflect new login system.
-rw-r--r-- | README.md | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 { |