Skip to content

Commit fa4dc36

Browse files
committed
Expose ReceiverFetcher of power-dist results from PowerWrapper
This can be used in the BatteryPool that users can use to get a direct stream of the power distributor results. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent f7666b6 commit fa4dc36

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/frequenz/sdk/microgrid/_power_wrapper.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# pylint: disable=cyclic-import
1717
from frequenz.client.microgrid import ComponentCategory, ComponentType
1818

19+
from .._internal._channels import ReceiverFetcher
20+
1921
# A number of imports had to be done inside functions where they are used, to break
2022
# import cycles.
2123
#
@@ -178,3 +180,7 @@ async def stop(self) -> None:
178180
await self._power_distributing_actor.stop()
179181
if self._power_managing_actor:
180182
await self._power_managing_actor.stop()
183+
184+
def distribution_results_fetcher(self) -> ReceiverFetcher[Result]:
185+
"""Return a fetcher for the power distribution results."""
186+
return self._power_distribution_results_channel

0 commit comments

Comments
 (0)