Generate HTTP endpoints for environment sensors
- Move update request sanity checks to new method in handlers/util.go - Change EnvironmentSensor.Value type because ParseFloat returns float64
This commit is contained in:
parent
6e1a8ac0e6
commit
38710484f9
5 changed files with 102 additions and 27 deletions
|
@ -41,11 +41,12 @@ type SpaceAPIResponseV14 struct {
|
|||
}
|
||||
|
||||
type EnvironmentSensor struct {
|
||||
Value float32 `json:"value"`
|
||||
Value float64 `json:"value"`
|
||||
Unit string `json:"unit"`
|
||||
Location string `json:"location"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
LastChange int64 `json:"lastchange"`
|
||||
}
|
||||
|
||||
type PersistentStateV14 struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue