Skip to content

Commit

Permalink
chore: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Jan 10, 2025
1 parent b812c2b commit 76dc949
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions charger/mypv.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,12 @@ func (wb *MyPv) heartbeat(ctx context.Context, timeout time.Duration) {

// Status implements the api.Charger interface
func (wb *MyPv) Status() (api.ChargeStatus, error) {
res := api.StatusA
b, err := wb.conn.ReadHoldingRegisters(elwaRegStatus, 1)
if err != nil {
return res, err
return api.StatusNone, err
}

res = api.StatusB
res := api.StatusB
if binary.BigEndian.Uint16(b) == 2 {
res = api.StatusC
}
Expand Down

0 comments on commit 76dc949

Please sign in to comment.