Send stringable nil value to influx
This commit is contained in:
parent
c7d2e8f31b
commit
018836d663
1 changed files with 9 additions and 1 deletions
10
core/api.go
10
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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue