still polishing.

This commit is contained in:
David Newhall II 2019-01-26 13:14:27 -08:00
parent 7ac3b0e1f3
commit 15558b09a5
2 changed files with 5 additions and 2 deletions

View File

@ -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 {

View File

@ -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
}
}