Skip to content

Commit

Permalink
[pre-commit.ci lite] apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored Jan 28, 2024
1 parent def589e commit b0df89d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apps/predbat/predbat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3720,7 +3720,7 @@ def get_charge_rate_curve(self, soc, charge_rate_setting):
soc_percent = self.calc_percent_limit(soc)
max_charge_rate = self.battery_rate_max_charge * self.battery_charge_power_curve.get(soc_percent, 1.0) * self.battery_rate_max_scaling
return max(min(charge_rate_setting, max_charge_rate), self.battery_rate_min)

def run_prediction(self, charge_limit, charge_window, discharge_window, discharge_limits, load_minutes_step, pv_forecast_minute_step, end_record, save=None, step=PREDICT_STEP):
"""
Run a prediction scenario given a charge limit, options to save the results or not to HA entity
Expand Down Expand Up @@ -8580,7 +8580,11 @@ def find_charge_rate(self, minutes_now, soc, window, target_soc, max_rate, quiet
break
rate_w -= 125.0
if not quiet:
self.log("Find charge rate now {} soc {} window {} target_soc {} max_rate {} min_rate {} returns {}".format(minutes_now, soc, window, target_soc, int(max_rate * 60.0 * 1000.0), int(min_rate * 60.0 * 1000.0), int(best_rate * 60.0 * 1000.0)))
self.log(
"Find charge rate now {} soc {} window {} target_soc {} max_rate {} min_rate {} returns {}".format(
minutes_now, soc, window, target_soc, int(max_rate * 60.0 * 1000.0), int(min_rate * 60.0 * 1000.0), int(best_rate * 60.0 * 1000.0)
)
)
return best_rate
else:
return max_rate
Expand Down Expand Up @@ -11008,4 +11012,4 @@ def run_time_loop_balance(self, cb_args):
except Exception as e:
self.log("ERROR: Exception raised {}".format(e))
self.record_status("ERROR: Exception raised {}".format(e))
raise
raise

0 comments on commit b0df89d

Please sign in to comment.