Skip to content

request

frequenz.sdk.actor.power_distributing.request ¤

Definition of the user request.

Classes¤

frequenz.sdk.actor.power_distributing.request.Request dataclass ¤

Request to set power to the PowerDistributingActor.

Source code in frequenz/sdk/actor/power_distributing/request.py
@dataclasses.dataclass
class Request:
    """Request to set power to the `PowerDistributingActor`."""

    power: Power
    """The requested power."""

    component_ids: abc.Set[int]
    """The component ids of the components to be used for this request."""

    request_timeout: timedelta = timedelta(seconds=5.0)
    """The maximum amount of time to wait for the request to be fulfilled."""

    adjust_power: bool = True
    """Whether to adjust the power to match the bounds.

    If `True`, the power will be adjusted (lowered) to match the bounds, so
    only the reduced power will be set.

    If `False` and the power is outside the available bounds, the request will
    fail and be replied to with an `OutOfBound` result.
    """
Attributes¤
adjust_power class-attribute instance-attribute ¤
adjust_power: bool = True

Whether to adjust the power to match the bounds.

If True, the power will be adjusted (lowered) to match the bounds, so only the reduced power will be set.

If False and the power is outside the available bounds, the request will fail and be replied to with an OutOfBound result.

component_ids instance-attribute ¤
component_ids: Set[int]

The component ids of the components to be used for this request.

power instance-attribute ¤
power: Power

The requested power.

request_timeout class-attribute instance-attribute ¤
request_timeout: timedelta = timedelta(seconds=5.0)

The maximum amount of time to wait for the request to be fulfilled.