Revert "Daheimladen: fix misleading sponsorship error on station id read (#31956)"
This reverts commit 279c77ba9d.
This commit is contained in:
parent
9db7be1ede
commit
834c062b8c
1 changed files with 2 additions and 6 deletions
|
|
@ -20,7 +20,6 @@ package charger
|
|||
import (
|
||||
"context"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
|
|
@ -94,11 +93,8 @@ func NewDaheimLaden(ctx context.Context, uri string, id uint8, phases bool) (api
|
|||
}
|
||||
|
||||
c, err := conn.ReadHoldingRegisters(dlRegStationId, 16)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("station id: %w", err)
|
||||
}
|
||||
if s, _ := utf16BEBytesAsString(c); s == "" {
|
||||
return nil, errors.New("station id not found, device may not be a DaheimLaden")
|
||||
if s, _ := utf16BEBytesAsString(c); err != nil || s == "" {
|
||||
return nil, api.ErrSponsorRequired
|
||||
}
|
||||
|
||||
log := util.NewLogger("daheimladen")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue