Skip to content

Commit 88ad5a1

Browse files
authored
Fix bug in how failed batteries are tracked in PowerDistributor (#705)
There are tests for this case coming with the PowerManager, so not adding them here.
2 parents 0399bdc + a6ea28e commit 88ad5a1

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)