OpenWB Pro: fix disabling

This commit is contained in:
andig 2022-02-21 10:19:36 +01:00
parent 56c53eb7c8
commit 7008a4b1f6

View file

@ -119,12 +119,12 @@ func (wb *OpenWBPro) Enabled() (bool, error) {
// Enable implements the api.Charger interface
func (wb *OpenWBPro) Enable(enable bool) error {
var current float64
payload := "ampere=0"
if enable {
current = float64(wb.current)
payload = fmt.Sprintf("ampere=%.1f", wb.current)
}
return wb.set(fmt.Sprintf("ampere=%.1f", current))
return wb.set(payload)
}
// MaxCurrent implements the api.Charger interface