Skip to content

Commit

Permalink
Fix crash with 'new_soc_percent' (#1533)
Browse files Browse the repository at this point in the history
  • Loading branch information
springfall2008 authored Oct 13, 2024
1 parent 1b370e7 commit 4034e57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/predbat/predbat.py
Original file line number Diff line number Diff line change
Expand Up @@ -8311,11 +8311,11 @@ def adjust_battery_target_multi(self, inverter, soc, is_charging, is_discharging
new_soc_percent = soc
self.log("Inverter {} adjust target soc for hold to {}% based on requested all inverter soc {}%".format(inverter.id, new_soc_percent, soc))
elif soc == 100.0:
self.log("Inverter {} adjust target soc for charge to {}% based on requested all inverter soc {}%".format(inverter.id, new_soc_percent, soc))
new_soc_percent = 100.0
self.log("Inverter {} adjust target soc for charge to {}% based on requested all inverter soc {}%".format(inverter.id, new_soc_percent, soc))
elif soc == 0.0:
self.log("Inverter {} adjust target soc for discharge to {}% based on requested all inverter soc {}%".format(inverter.id, new_soc_percent, soc))
new_soc_percent = 0.0
self.log("Inverter {} adjust target soc for discharge to {}% based on requested all inverter soc {}%".format(inverter.id, new_soc_percent, soc))
else:
add_kwh = target_kwh - self.soc_kw
add_this = add_kwh * (inverter.battery_rate_max_charge / self.battery_rate_max_charge)
Expand Down

0 comments on commit 4034e57

Please sign in to comment.