chore: better error handling
This commit is contained in:
parent
ca0f9e9f18
commit
03da1f129f
1 changed files with 5 additions and 2 deletions
|
|
@ -203,9 +203,12 @@ func (wb *DaheimLadenMB) MaxCurrent(current int64) error {
|
|||
return fmt.Errorf("invalid current %d", current)
|
||||
}
|
||||
|
||||
wb.curr = uint16(current * 10)
|
||||
err := wb.setCurrent(wb.curr)
|
||||
if err == nil {
|
||||
wb.curr = uint16(current * 10)
|
||||
}
|
||||
|
||||
return wb.setCurrent(wb.curr)
|
||||
return err
|
||||
}
|
||||
|
||||
var _ api.Meter = (*DaheimLadenMB)(nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue