Skip to content

Commit

Permalink
Victron: fix reading charged enery
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Dec 27, 2023
1 parent 170e2ca commit 3ac59b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion charger/victron.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ var _ api.ChargeRater = (*Victron)(nil)

// ChargedEnergy implements the api.MeterEnergy interface
func (wb *Victron) ChargedEnergy() (float64, error) {
b, err := wb.conn.ReadHoldingRegisters(wb.regs.Energy, cast.ToUint16(wb.regs.isGX))
b, err := wb.conn.ReadHoldingRegisters(wb.regs.Energy, 1+cast.ToUint16(wb.regs.isGX))
if err != nil {
return 0, err
}
Expand Down

0 comments on commit 3ac59b3

Please sign in to comment.