From 018836d663fae0ea2ad4eaaf642c1ea11dbd5792 Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 19 Apr 2020 20:49:31 +0200 Subject: [PATCH] Send stringable nil value to influx --- core/api.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/api.go b/core/api.go index 4ffee435b..9054a66bb 100644 --- a/core/api.go +++ b/core/api.go @@ -7,6 +7,13 @@ import ( "github.com/andig/evcc/core/wrapper" ) +// NilVal implements Stringer for nil values +type NilVal int + +func (n *NilVal) String() string { + return "—" +} + // Param is the broadcast channel data type type Param struct { LoadPoint string @@ -155,6 +162,7 @@ func (lp *LoadPoint) publishSoC() { log.ERROR.Printf("%s vehicle error: %v", lp.Name, err) } - lp.publish("socCharge", "—") + var n *NilVal + lp.publish("socCharge", n) lp.publish("chargeEstimate", -1) }