Skip to content

Commit a6ea28e

Browse files
committed
Fix bug in how failed batteries are tracked in PowerDistributor
There are tests for this case coming with the PowerManager, so not adding them here. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 0399bdc commit a6ea28e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ def _parse_result(
740740
aws.result()
741741
except grpc.aio.AioRpcError as err:
742742
failed_power += distribution[inverter_id]
743-
failed_batteries.union(battery_ids)
743+
failed_batteries = failed_batteries.union(battery_ids)
744744
if err.code() == grpc.StatusCode.OUT_OF_RANGE:
745745
_logger.debug(
746746
"Set power for battery %s failed, error %s",
@@ -755,7 +755,7 @@ def _parse_result(
755755
)
756756
except asyncio.exceptions.CancelledError:
757757
failed_power += distribution[inverter_id]
758-
failed_batteries.union(battery_ids)
758+
failed_batteries = failed_batteries.union(battery_ids)
759759
_logger.warning(
760760
"Battery %s didn't respond in %f sec. Mark it as broken.",
761761
battery_ids,

0 commit comments

Comments
 (0)