chore: align comments

This commit is contained in:
andig 2022-06-16 11:18:46 +02:00
parent f618cdf980
commit 456100600e
4 changed files with 10 additions and 7 deletions

View file

@ -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])

View file

@ -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)

View file

@ -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)

View file

@ -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))