From ca0b667ea16f0375cf6a0f25e78a926963785414 Mon Sep 17 00:00:00 2001 From: Darell Tan Date: Fri, 16 Jun 2023 22:47:12 +0800 Subject: [PATCH] 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. --- z2m.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/z2m.go b/z2m.go index a43e99c..e063a88 100644 --- a/z2m.go +++ b/z2m.go @@ -354,7 +354,7 @@ type ExposesEntry struct { Features []ExposesEntry `json:"features"` // values - Values []string `json:"values"` + Values []any `json:"values"` ValueOn any `json:"value_on"` ValueOff any `json:"value_off"`