diff --git a/charger/wallbe.go b/charger/wallbe.go index e927abad9..8b5a1f4dc 100644 --- a/charger/wallbe.go +++ b/charger/wallbe.go @@ -3,7 +3,6 @@ package charger import ( "encoding/binary" "fmt" - "time" "github.com/evcc-io/evcc/api" "github.com/evcc-io/evcc/util" @@ -165,20 +164,6 @@ func (wb *Wallbe) maxCurrentMillis(current float64) error { return err } -var _ api.ChargeTimer = (*Wallbe)(nil) - -// ChargingTime implements the api.ChargeTimer interface -func (wb *Wallbe) ChargingTime() (time.Duration, error) { - b, err := wb.conn.ReadInputRegisters(wbRegChargeTime, 2) - if err != nil { - return 0, err - } - - // 2 words, least significant word first - secs := uint64(b[1]) | uint64(b[0])<<8 | uint64(b[3])<<16 | uint64(b[2])<<24 - return time.Duration(secs) * time.Second, nil -} - // currentPower implements the api.Meter interface func (wb *Wallbe) currentPower() (float64, error) { b, err := wb.conn.ReadInputRegisters(wbRegPower, 2) diff --git a/charger/wallbe_test.go b/charger/wallbe_test.go deleted file mode 100644 index 496614e27..000000000 --- a/charger/wallbe_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package charger - -import ( - "testing" - - "github.com/evcc-io/evcc/api" -) - -func TestWallbeLegacy(t *testing.T) { - wbc, err := NewWallbeFromConfig(map[string]interface{}{"legacy": true}) - if err != nil { - t.Error(err) - } - - wb, ok := wbc.(*Wallbe) - if !ok { - t.Error("unexpected type") - } - - if wb.factor != 1 { - t.Errorf("invalid factor: %d", wb.factor) - } - - if _, ok = wbc.(api.ChargeTimer); !ok { - t.Error("missing charge timer api") - } - - if _, ok = wbc.(api.Diagnosis); !ok { - t.Error("missing diagnosis api") - } -} - -func TestWallbeEx(t *testing.T) { - wbc, err := NewWallbeFromConfig(map[string]interface{}{"legacy": false}) - if err != nil { - t.Error(err) - } - - if _, ok := wbc.(api.ChargerEx); !ok { - t.Error("missing ChargerEx api") - } - - if _, ok := wbc.(api.ChargeTimer); !ok { - t.Error("missing ChargeTimer api") - } - - if _, ok := wbc.(api.Diagnosis); !ok { - t.Error("missing Diagnosis api") - } -}