Skip to content

Commit

Permalink
OpenWB 2: fix negative phase readings
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Jan 2, 2024
1 parent f14b83c commit 7320e73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion charger/openwb-2.0.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (wb *OpenWB20) getPhaseValues(reg uint16) (float64, float64, float64, error

var res [3]float64
for i := range res {
res[i] = float64(binary.BigEndian.Uint16(b[2*i:])) / 100
res[i] = float64(int16(binary.BigEndian.Uint16(b[2*i:]))) / 100
}

return res[0], res[1], res[2], nil
Expand Down

0 comments on commit 7320e73

Please sign in to comment.