OpenWB: invert battery sign (#5958)
This commit is contained in:
parent
c496ed8028
commit
7d839df63a
1 changed files with 5 additions and 1 deletions
|
|
@ -101,7 +101,11 @@ func NewOpenWBFromConfig(other map[string]interface{}) (api.Meter, error) {
|
|||
return nil, errors.New("battery not available")
|
||||
}
|
||||
|
||||
power = floatG(fmt.Sprintf("%s/housebattery/%s", cc.Topic, openwb.PowerTopic))
|
||||
inner := floatG(fmt.Sprintf("%s/housebattery/%s", cc.Topic, openwb.PowerTopic))
|
||||
power = func() (float64, error) {
|
||||
f, err := inner()
|
||||
return -f, err
|
||||
}
|
||||
soc = floatG(fmt.Sprintf("%s/housebattery/%s", cc.Topic, openwb.SocTopic))
|
||||
capacity = cc.capacity.Decorator()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue