Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Oct 4, 2024
2 parents c0933d5 + b8d8758 commit d330630
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions charger/vestel.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@ func (wb *Vestel) Status() (api.ChargeStatus, error) {
// Enabled implements the api.Charger interface
func (wb *Vestel) Enabled() (bool, error) {
return verifyEnabled(wb, wb.enabled)

// b, err := wb.conn.ReadHoldingRegisters(vestelRegMaxCurrent, 1)
// if err != nil {
// return false, err
// }

// return binary.BigEndian.Uint16(b) > 0, nil
}

// Enable implements the api.Charger interface
Expand Down Expand Up @@ -180,6 +173,18 @@ func (wb *Vestel) MaxCurrent(current int64) error {
return err
}

var _ api.CurrentGetter = (*Vestel)(nil)

// GetMaxCurrent implements the api.CurrentGetter interface
func (wb *Vestel) GetMaxCurrent() (float64, error) {
b, err := wb.conn.ReadHoldingRegisters(vestelRegMaxCurrent, 1)
if err != nil {
return 0, err
}

return float64(binary.BigEndian.Uint16(b)), nil
}

var _ api.ChargeTimer = (*Vestel)(nil)

// ChargeDuration implements the api.ChargeTimer interface
Expand Down

0 comments on commit d330630

Please sign in to comment.