Skip to content

Commit

Permalink
Fixes Louisvdw#919
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Jan 12, 2024
1 parent da0f524 commit ea69264
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions etc/dbus-serialbattery/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,10 @@ def manage_charge_current(self) -> None:

# if BMS limit is lower then config limit and therefore the values are not the same,
# then the limit was also read from the BMS
if utils.MAX_BATTERY_CHARGE_CURRENT > self.max_battery_charge_current:
if (
isinstance(self.max_battery_charge_current, (int, float))
and utils.MAX_BATTERY_CHARGE_CURRENT > self.max_battery_charge_current
):
charge_limits.update({self.max_battery_charge_current: "BMS Settings"})

if utils.CCCM_CV_ENABLE:
Expand Down Expand Up @@ -747,7 +750,10 @@ def manage_charge_current(self) -> None:

# if BMS limit is lower then config limit and therefore the values are not the same,
# then the limit was also read from the BMS
if utils.MAX_BATTERY_DISCHARGE_CURRENT > self.max_battery_discharge_current:
if (
isinstance(self.max_battery_discharge_current, (int, float))
and utils.MAX_BATTERY_DISCHARGE_CURRENT > self.max_battery_discharge_current
):
discharge_limits.update(
{self.max_battery_discharge_current: "BMS Settings"}
)
Expand Down

0 comments on commit ea69264

Please sign in to comment.