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:
Bendodroid 2024-01-14 01:04:01 +01:00
commit 38710484f9
Signed by: bendodroid
GPG key ID: 3EEE19A0F73D5FFC
5 changed files with 102 additions and 27 deletions

View file

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