Skip to content

Commit

Permalink
fixes LLT/JBD SOC > 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Sep 21, 2023
1 parent fea0eff commit 17e84e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion etc/dbus-serialbattery/bms/lltjbd.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ def read_gen_data(self):
) = unpack_from(">HhHHHHhHHBBBBB", gen_data)
self.voltage = voltage / 100
self.current = current / 100
if not self.cycle_capacity:
# https://github.com/Louisvdw/dbus-serialbattery/issues/769#issuecomment-1720805325
if not self.cycle_capacity or self.cycle_capacity < capacity_remain:
self.cycle_capacity = capacity
self.soc = round(100 * capacity_remain / self.cycle_capacity, 2)
self.capacity_remain = capacity_remain / 100
Expand Down
2 changes: 1 addition & 1 deletion etc/dbus-serialbattery/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _get_list_from_config(


# Constants
DRIVER_VERSION = "1.0.20230919dev"
DRIVER_VERSION = "1.0.20230921dev"
zero_char = chr(48)
degree_sign = "\N{DEGREE SIGN}"

Expand Down

0 comments on commit 17e84e2

Please sign in to comment.