Skip to content

Commit 5ab4b4a

Browse files
kopierschnittemr-manuel
authored andcommitted
Fix energy calculations to divide by 100
Fixed division to match https://github.com/cpttinkering/daren-485#response-6
1 parent a43f57d commit 5ab4b4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dbus-serialbattery/bms/ks48100.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ def get_cap_params(self, ser):
237237
self.total_charge_capacity = int(payload[12:20], base=16) / 1
238238
# total_discharge_capacity
239239
self.history.total_ah_drawn = int(payload[20:28], base=16)
240-
self.history.charged_energy = int(int(payload[28:32], base=16) / 10)
241-
self.history.discharged_energy = int(int(payload[32:36], base=16) / 10)
240+
self.history.charged_energy = int(int(payload[28:32], base=16) / 100)
241+
self.history.discharged_energy = int(int(payload[32:36], base=16) / 100)
242242

243243
result = True
244244
else:

0 commit comments

Comments
 (0)