Skip to content

Commit

Permalink
Daheimladen Modbus: fix MaxCurrent
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Oct 12, 2023
1 parent 68b2150 commit e358339
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions charger/daheimladen-mb.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,10 @@ func (wb *DaheimLadenMB) MaxCurrent(current int64) error {
return fmt.Errorf("invalid current %d", current)
}

err := wb.setCurrent(wb.curr)
curr := uint16(current * 10)
err := wb.setCurrent(curr)
if err == nil {
wb.curr = uint16(current * 10)
wb.curr = curr
}

return err
Expand Down

0 comments on commit e358339

Please sign in to comment.