Skip to content

Commit 6bc8442

Browse files
Swap tail fix
1 parent 5157f89 commit 6bc8442

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

apps/predbat/plan.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2288,7 +2288,7 @@ def optimise_swap_export(self, record_charge_windows, record_export_windows, deb
22882288
swapped = False
22892289

22902290
for window_n_target in range(record_export_windows - 1, 0, -1):
2291-
previous_end = 0
2291+
previous_end_target = 0
22922292
if window_n_target > 0:
22932293
previous_end_target = self.export_window_best[window_n_target - 1]["end"]
22942294
window_start_target = self.export_window_best[window_n_target]["start"]
@@ -2351,6 +2351,10 @@ def optimise_swap_export(self, record_charge_windows, record_export_windows, deb
23512351
# Don't swap if the windows are the same
23522352
continue
23532353

2354+
if export_limit < 100 and export_limit_target < 100 and window_length < window_length_target:
2355+
# Don't swap if we move a smaller window later
2356+
continue
2357+
23542358
if export_limit < 99 and window_length <= window_length_target:
23552359
# Don't optimise a charge window that hits an export window if this is disallowed
23562360
if not self.calculate_export_oncharge:

apps/predbat/predbat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import requests
3737
import asyncio
3838

39-
THIS_VERSION = "v8.20.2"
39+
THIS_VERSION = "v8.20.3"
4040

4141
# fmt: off
4242
PREDBAT_FILES = ["predbat.py", "config.py", "prediction.py", "gecloud.py","utils.py", "inverter.py", "ha.py", "download.py", "unit_test.py", "web.py", "predheat.py", "futurerate.py", "octopus.py", "solcast.py","execute.py", "plan.py", "fetch.py", "output.py", "userinterface.py", "energydataservice.py", "alertfeed.py", "compare.py", "db_manager.py", "db_engine.py"]

0 commit comments

Comments
 (0)