forked from mamu/spacepanel_aggregator
reduced v13 struct to doorstatus only
This commit is contained in:
parent
9cefcf2ff0
commit
a17161d861
|
@ -12,6 +12,7 @@ func Poll(url string, led int) {
|
||||||
for true {
|
for true {
|
||||||
resp, err := http.Get(url)
|
resp, err := http.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
err.Error()
|
||||||
ErrorPoll(url, err, led)
|
ErrorPoll(url, err, led)
|
||||||
} else {
|
} else {
|
||||||
data, err := ioutil.ReadAll(resp.Body)
|
data, err := ioutil.ReadAll(resp.Body)
|
||||||
|
@ -21,7 +22,7 @@ func Poll(url string, led int) {
|
||||||
} else {
|
} else {
|
||||||
_ = resp.Body.Close()
|
_ = resp.Body.Close()
|
||||||
|
|
||||||
var parsed V13
|
var parsed dooronly
|
||||||
err = json.Unmarshal(data, &parsed)
|
err = json.Unmarshal(data, &parsed)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ErrorPoll(url, err, led)
|
ErrorPoll(url, err, led)
|
||||||
|
|
Loading…
Reference in New Issue