diff --git a/charger/dadapower.go b/charger/dadapower.go index 4a267200a..25cbcd910 100644 --- a/charger/dadapower.go +++ b/charger/dadapower.go @@ -225,7 +225,9 @@ func (wb *Dadapower) Identify() (string, error) { return string(u), nil } -// Diagnose implements the Diagnosis interface +var _ api.Diagnosis = (*Dadapower)(nil) + +// Diagnose implements the api.Diagnosis interface func (wb *Dadapower) Diagnose() { if b, err := wb.conn.ReadInputRegisters(dadapowerRegModel, 1); err == nil { fmt.Printf("Model:\t%d\n", b[1]) diff --git a/charger/innogy.go b/charger/innogy.go index 46acdb888..5fa3613fa 100644 --- a/charger/innogy.go +++ b/charger/innogy.go @@ -191,7 +191,7 @@ func (wb *Innogy) Currents() (float64, float64, float64, error) { var _ api.Diagnosis = (*Innogy)(nil) -// Diagnose implements the Diagnosis interface +// Diagnose implements the api.Diagnosis interface func (wb *Innogy) Diagnose() { if b, err := wb.conn.ReadInputRegisters(igyRegManufacturer, 25); err == nil { fmt.Printf("Manufacturer:\t%s\n", b) diff --git a/charger/vestel.go b/charger/vestel.go index 937b6032d..742227cfd 100644 --- a/charger/vestel.go +++ b/charger/vestel.go @@ -46,7 +46,7 @@ const ( var vestelRegCurrents = []uint16{1008, 1010, 1012} -// Vestel is an api.ChargeController implementation for Vestel/Hymes wallboxes with Ethernet (SW modells). +// Vestel is an api.Charger implementation for Vestel/Hymes wallboxes with Ethernet (SW modells). // It uses Modbus TCP to communicate with the wallbox at modbus client id 255. type Vestel struct { log *util.Logger @@ -172,8 +172,7 @@ func (wb *Vestel) ChargingTime() (time.Duration, error) { return 0, err } - secs := binary.BigEndian.Uint32(b) - return time.Duration(time.Duration(secs) * time.Second), nil + return time.Duration(binary.BigEndian.Uint32(b)) * time.Second, nil } var _ api.Meter = (*Vestel)(nil) @@ -229,7 +228,9 @@ func (wb *Vestel) Currents() (float64, float64, float64, error) { return currents[0], currents[1], currents[2], nil } -// Diagnose implements the Diagnosis interface +var _ api.Diagnosis = (*Vestel)(nil) + +// Diagnose implements the api.Diagnosis interface func (wb *Vestel) Diagnose() { if b, err := wb.conn.ReadInputRegisters(vestelRegBrand, 10); err == nil { fmt.Printf("Brand:\t%s\n", b) diff --git a/charger/wallbe.go b/charger/wallbe.go index 041c5629e..b9ddad337 100644 --- a/charger/wallbe.go +++ b/charger/wallbe.go @@ -225,7 +225,7 @@ func (wb *Wallbe) currents() (float64, float64, float64, error) { var _ api.Diagnosis = (*Wallbe)(nil) -// Diagnose implements the Diagnosis interface +// Diagnose implements the api.Diagnosis interface func (wb *Wallbe) Diagnose() { if b, err := wb.conn.ReadInputRegisters(wbRegFirmware, 6); err == nil { fmt.Printf("Firmware:\t%s\n", encoding.StringLsbFirst(b))