Z2M JSON exposes.values could be of numeric type

encoding/json would refuse to implicitly cast the numbers into strings.
Currently we don't use these values, so let's preserve their type using
`any` for now.

An example is `keep_time` for occupancy sensors, where it's
[30, 60, 120] seconds.
This commit is contained in:
Darell Tan
2023-06-16 22:47:12 +08:00
parent 48eabc2342
commit ca0b667ea1

2
z2m.go
View File

@@ -354,7 +354,7 @@ type ExposesEntry struct {
Features []ExposesEntry `json:"features"` Features []ExposesEntry `json:"features"`
// values // values
Values []string `json:"values"` Values []any `json:"values"`
ValueOn any `json:"value_on"` ValueOn any `json:"value_on"`
ValueOff any `json:"value_off"` ValueOff any `json:"value_off"`