small fix in user

This commit is contained in:
Your Name 2019-02-09 18:05:54 +01:00
parent 11eb5f4e93
commit 71905b94d2
2 changed files with 2 additions and 7 deletions

View File

@ -1,11 +1,8 @@
package main
import (
"bytes"
"fmt"
"gopkg.in/yaml.v2"
"io/ioutil"
"net/http"
)
// Config hue api config

View File

@ -14,13 +14,11 @@ type User struct {
}
// CreateNewUser will create a new user. This should be called only of there's none in the yaml config.
func CreateUser(addr string) (name, key string, succ bool) {
func CreateUser(addr string) (u *User, err error) {
return CreateUserExtended(addr, "go-hue-interface", "Philips hue")
}
// TODO: remove these comments
// example application: "go.hue.interface"
// example deviceName: "Philips hue"
func CreateUserExtended(addr, application, deviceName string) (u *User, err error) {
uri := "http://" + addr + "/api"