still polishing.
This commit is contained in:
parent
7ac3b0e1f3
commit
15558b09a5
|
|
@ -7,6 +7,7 @@ import (
|
|||
"net/http"
|
||||
"net/http/cookiejar"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
|
@ -87,7 +88,9 @@ func GetController(user, pass, url string, verifySSL bool) (*Unifi, error) {
|
|||
Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: !verifySSL}},
|
||||
Jar: jar,
|
||||
},
|
||||
baseURL: url,
|
||||
}
|
||||
if u.baseURL = url; strings.HasSuffix(url, "/") {
|
||||
u.baseURL = url[:len(url)-1]
|
||||
}
|
||||
req, err := u.UniReq(LoginPath, json)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ func (u *Unifi) parseDevices(data []json.RawMessage) *Devices {
|
|||
}
|
||||
devices.USWs = append(devices.USWs, usw)
|
||||
default:
|
||||
u.dLogf("unknown asset type - " + assetType + " - skipping")
|
||||
u.eLogf("unknown asset type - %v - skipping", assetType)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue