Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

- The client now inherits from `frequenz.client.base.BaseApiClient`, so it provides a few new features, like `disconnect()`ing or using it as a context manager. Please refer to the [`BaseApiClient` documentation](https://frequenz-floss.github.io/frequenz-client-base-python/latest/reference/frequenz/client/base/client/#frequenz.client.base.client.BaseApiClient) for more information on these features.

- The client now supports setting reactive power for components through the new `set_reactive_power` method.

## Bug Fixes

<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
28 changes: 28 additions & 0 deletions src/frequenz/client/microgrid/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,34 @@ async def set_power( # noqa: DOC502 (raises ApiClientError indirectly)
method_name="SetPowerActive",
)

async def set_reactive_power( # noqa: DOC502 (raises ApiClientError indirectly)
self, component_id: int, reactive_power_var: float
) -> None:
"""Send request to the Microgrid to set reactive power for component.

Negative values are for inductive (lagging) power , and positive values are for
capacitive (leading) power.

Args:
component_id: id of the component to set power.
reactive_power_var: reactive power to set for the component.

Raises:
ApiClientError: If the are any errors communicating with the Microgrid API,
most likely a subclass of
[GrpcError][frequenz.client.microgrid.GrpcError].
"""
await client.call_stub_method(
self,
lambda: self._async_stub.SetPowerReactive(
microgrid_pb2.SetPowerReactiveParam(
component_id=component_id, power=reactive_power_var
),
timeout=int(DEFAULT_GRPC_CALL_TIMEOUT),
),
method_name="SetPowerReactive",
)

async def set_bounds( # noqa: DOC503 (raises ApiClientError indirectly)
self,
component_id: int,
Expand Down
Loading