wip battery swap control

This commit is contained in:
Lucas Tan 2025-07-19 13:09:24 +01:00
parent 04cf0cdf29
commit ee8d0125bc
2 changed files with 8 additions and 0 deletions

View File

@ -91,3 +91,9 @@ def update_cycle_SoC(bess_data, bess_soc_for_cycle, timestamps):
],
axis=0,
)
def arrange_swap(bess_data, c):
for unit in bess_data["units"]:
if unit["SoC"] < c["bess"]["buffer"]:
# find for unassigned BESS unit with SOC at 100%

View File

@ -76,6 +76,8 @@ with ThreadPoolExecutor() as executor:
else:
is_running_in_async = False
# check if any BESS units are below threshold (buffer as defined in config)
# discharge BESS for each site
for site in c["site_info"]["sites"]:
site_name = site["name"]