Skip to content

Commit dedd6d4

Browse files
Fix power failure report
The succeeded power in PartialFailure result should exclude any failed power. Signed-off-by: Daniel Zullo <[email protected]>
1 parent 5e21938 commit dedd6d4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ This version ships an experimental version of the **Power Manager**, adds prelim
7272
- The `__getitem__` magic of the `MovingWindow` is fixed to support the same functionality that the `window` method provides.
7373
- Fixes incorrect implementation of single element access in `__getitem__` magic of `MovingWindow`.
7474
- Fix incorrect grid current calculations in locations where the calculations depended on current measurements from an inverter.
75+
- Fix power failure report to exclude any failed power from the succeeded power.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,9 @@ async def _run(self) -> None: # pylint: disable=too-many-locals
350350
succeed_batteries = set(battery_distribution.keys()) - failed_batteries
351351
response = PartialFailure(
352352
request=request,
353-
succeeded_power=Power.from_watts(distributed_power_value),
353+
succeeded_power=Power.from_watts(
354+
distributed_power_value - failed_power
355+
),
354356
succeeded_batteries=succeed_batteries,
355357
failed_power=Power.from_watts(failed_power),
356358
failed_batteries=failed_batteries,

0 commit comments

Comments
 (0)