Skip to content

Commit

Permalink
soc_calc: Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
cflenker committed Nov 26, 2023
1 parent 1893b53 commit c141d20
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions etc/dbus-serialbattery/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def soc_calculation(self) -> None:
)
else:
current_corr = self.current

self.soc_calc_capacity_remain = (
self.soc_calc_capacity_remain
+ current_corr
Expand All @@ -292,7 +292,9 @@ def soc_calculation(self) -> None:
else:
self.soc_calc_reset_starttime = int(current_time)
else:
self.soc_calc_capacity_remain = utils.SOC_CALC_INIT_VALUE
self.soc_calc_capacity_remain = (
self.capacity * utils.SOC_CALC_INIT_VALUE / 100
)
self.soc_calc_capacity_remain_lasttime = current_time

# Calculate the SOC based on remaining capacity
Expand Down

0 comments on commit c141d20

Please sign in to comment.