Handle sensors that don't have a name, just a location
This commit is contained in:
parent
04b7efd74a
commit
0241a506d4
3 changed files with 20 additions and 9 deletions
10
types/v14.go
10
types/v14.go
|
@ -46,9 +46,9 @@ type EnvironmentSensor struct {
|
|||
Value float64 `json:"value"`
|
||||
Unit string `json:"unit"`
|
||||
Location string `json:"location"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
LastChange int64 `json:"lastchange"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
LastChange int64 `json:"lastchange,omitempty"`
|
||||
}
|
||||
|
||||
type PersistentStateV14 struct {
|
||||
|
@ -56,12 +56,12 @@ type PersistentStateV14 struct {
|
|||
Open bool `json:"open"`
|
||||
LastChange int64 `json:"lastchange"`
|
||||
} `json:"state"`
|
||||
Sensors map[string][]PersistentEnvironmentSensor `json:"sensors"`
|
||||
Sensors map[string][]PersistentEnvironmentSensor `json:"sensors,omitempty"`
|
||||
}
|
||||
|
||||
type PersistentEnvironmentSensor struct {
|
||||
Value float64 `json:"value"`
|
||||
Location string `json:"location"`
|
||||
Name string `json:"name"`
|
||||
Name string `json:"name,omitempty"`
|
||||
LastChange int64 `json:"lastchange"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue