forked from mamu/spacepanel_aggregator
reduced v13 struct to doorstatus only
This commit is contained in:
parent
9cefcf2ff0
commit
a17161d861
2 changed files with 8 additions and 1 deletions
|
@ -12,6 +12,7 @@ func Poll(url string, led int) {
|
|||
for true {
|
||||
resp, err := http.Get(url)
|
||||
if err != nil {
|
||||
err.Error()
|
||||
ErrorPoll(url, err, led)
|
||||
} else {
|
||||
data, err := ioutil.ReadAll(resp.Body)
|
||||
|
@ -21,7 +22,7 @@ func Poll(url string, led int) {
|
|||
} else {
|
||||
_ = resp.Body.Close()
|
||||
|
||||
var parsed V13
|
||||
var parsed dooronly
|
||||
err = json.Unmarshal(data, &parsed)
|
||||
if err != nil {
|
||||
ErrorPoll(url, err, led)
|
||||
|
|
6
types.go
6
types.go
|
@ -237,3 +237,9 @@ type V13 struct {
|
|||
} `json:"stream"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
type dooronly struct {
|
||||
State struct {
|
||||
Open interface{} `json:"open"`
|
||||
} `json:"state"`
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue