Skip to content

Commit

Permalink
Send stringable nil value to influx
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Apr 19, 2020
1 parent c7d2e8f commit 018836d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/api.go
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}

0 comments on commit 018836d

Please sign in to comment.