OpenWB Pro: fix disabling
This commit is contained in:
parent
56c53eb7c8
commit
7008a4b1f6
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue