Skip to content

Commit 6edb9fb

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent 0f12066 commit 6edb9fb

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

‎apps/predbat/fox.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def pad_schedule(schedule, target_count, reserve, fdPwr_max):
142142
schedule.append(disabled_entry.copy())
143143
return schedule
144144

145+
145146
def validate_schedule(new_schedule, reserve, fdPwr_max, target_count=0):
146147
# Sort schedule by start time, closest to midnight first
147148
new_schedule = sort_schedule_by_start_time(new_schedule)
@@ -1763,6 +1764,7 @@ def set_arg(self, key, value):
17631764
state = "n/a"
17641765
print(f"Set arg {key} = {value} (state={state})")
17651766

1767+
17661768
async def test_write_schedule(sn, api_key, token_hash, token_expires, supabase_url, supabase_key, user_id): # pragma: no cover
17671769
"""
17681770
Write a hardcoded test schedule to the Fox API and read it back to verify
@@ -1773,7 +1775,7 @@ async def test_write_schedule(sn, api_key, token_hash, token_expires, supabase_u
17731775
os.environ["SUPABASE_KEY"] = supabase_key
17741776

17751777
schedule = [
1776-
{'endHour': 20, 'fdPwr': 7000, 'minSocOnGrid': 10, 'workMode': 'ForceDischarge', 'fdSoc': 10, 'enable': 1, 'startHour': 20, 'maxSoc': 100, 'startMinute': 16, 'endMinute': 30}, # 20:16 - 20:30
1778+
{"endHour": 20, "fdPwr": 7000, "minSocOnGrid": 10, "workMode": "ForceDischarge", "fdSoc": 10, "enable": 1, "startHour": 20, "maxSoc": 100, "startMinute": 16, "endMinute": 30}, # 20:16 - 20:30
17771779
]
17781780

17791781
mock_base = MockBase()
@@ -1822,8 +1824,6 @@ async def test_write_schedule(sn, api_key, token_hash, token_expires, supabase_u
18221824
print("WARNING: Written schedule does not match read-back schedule")
18231825

18241826

1825-
1826-
18271827
async def test_fox_api(sn, api_key, token_hash, token_expires, supabase_url, supabase_key, user_id): # pragma: no cover
18281828
"""
18291829
Run a test

‎apps/predbat/tests/test_fox_api.py‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,7 @@ def test_validate_schedule_padding_normal(my_predbat):
653653
print(" - test_validate_schedule_padding_normal")
654654

655655
# Single ForceCharge window 02:30 - 05:30 with target_count=8
656-
new_schedule = [
657-
{"enable": 1, "startHour": 2, "startMinute": 30, "endHour": 5, "endMinute": 30, "workMode": "ForceCharge", "fdSoc": 100, "maxSoc": 100, "fdPwr": 8000, "minSocOnGrid": 10}
658-
]
656+
new_schedule = [{"enable": 1, "startHour": 2, "startMinute": 30, "endHour": 5, "endMinute": 30, "workMode": "ForceCharge", "fdSoc": 100, "maxSoc": 100, "fdPwr": 8000, "minSocOnGrid": 10}]
659657
reserve = 10
660658
fdPwr_max = 8000
661659

@@ -715,9 +713,7 @@ def test_validate_schedule_padding_no_target(my_predbat):
715713
"""
716714
print(" - test_validate_schedule_padding_no_target")
717715

718-
new_schedule = [
719-
{"enable": 1, "startHour": 2, "startMinute": 0, "endHour": 5, "endMinute": 0, "workMode": "ForceCharge", "fdSoc": 100, "maxSoc": 100, "fdPwr": 8000, "minSocOnGrid": 10}
720-
]
716+
new_schedule = [{"enable": 1, "startHour": 2, "startMinute": 0, "endHour": 5, "endMinute": 0, "workMode": "ForceCharge", "fdSoc": 100, "maxSoc": 100, "fdPwr": 8000, "minSocOnGrid": 10}]
721717
reserve = 10
722718
fdPwr_max = 8000
723719

0 commit comments

Comments
 (0)