Only pass State struct pointer to StateOpen, not entire response
This commit is contained in:
parent
44143c0c2d
commit
70b2e8069b
3 changed files with 10 additions and 8 deletions
10
types/v14.go
10
types/v14.go
|
@ -11,10 +11,7 @@ type SpaceAPIResponseV14 struct {
|
|||
Lat float64 `json:"lat"`
|
||||
Lon float64 `json:"lon"`
|
||||
} `json:"location"`
|
||||
State struct {
|
||||
Open bool `json:"open"`
|
||||
LastChange int64 `json:"lastchange"`
|
||||
} `json:"state"`
|
||||
State SpaceState `json:"state"`
|
||||
Contact struct {
|
||||
Phone string `json:"phone"`
|
||||
IRC string `json:"irc"`
|
||||
|
@ -40,6 +37,11 @@ type SpaceAPIResponseV14 struct {
|
|||
} `json:"links"`
|
||||
}
|
||||
|
||||
type SpaceState struct {
|
||||
Open bool `json:"open"`
|
||||
LastChange int64 `json:"lastchange"`
|
||||
}
|
||||
|
||||
type EnvironmentSensor struct {
|
||||
Value float64 `json:"value"`
|
||||
Unit string `json:"unit"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue