Skip to content

Commit af12a29

Browse files
Change get_components_data to get data for working batteries only
This method is also used for preprocessing the request to check if request is correct before adding it to the main task queue. In methods: `_get_upper_bound` and `get_lower_bound`. Signed-off-by: ela-kotulska-frequenz <[email protected]>
1 parent 48a9d00 commit af12a29

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/frequenz/sdk/actor/power_distributing/power_distributing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ async def run(self) -> None:
266266

267267
try:
268268
pairs_data: List[InvBatPair] = self._get_components_data(
269-
self._all_battery_status.get_working_batteries(request.batteries)
269+
request.batteries
270270
)
271271
except KeyError as err:
272272
await user.channel.send(Error(request, str(err)))
@@ -548,8 +548,8 @@ def _get_components_data(self, batteries: Set[int]) -> List[InvBatPair]:
548548
Pairs of battery and adjacent inverter data.
549549
"""
550550
pairs_data: List[InvBatPair] = []
551-
552-
for battery_id in batteries:
551+
working_batteries = self._all_battery_status.get_working_batteries(batteries)
552+
for battery_id in working_batteries:
553553
if battery_id not in self._battery_receivers:
554554
raise KeyError(
555555
f"No battery {battery_id}, "

0 commit comments

Comments
 (0)