File tree Expand file tree Collapse file tree 3 files changed +26
-20
lines changed
src/frequenz/sdk/actor/power_distributing Expand file tree Collapse file tree 3 files changed +26
-20
lines changed Original file line number Diff line number Diff line change 1010PowerDistributingActor and send requests for charging or discharging power.
1111"""
1212
13- from .power_distributing import PowerDistributingActor , Request , Result
13+ from .power_distributing import PowerDistributingActor , Result
14+ from .request import Request
1415
1516__all__ = ["PowerDistributingActor" , "Request" , "Result" ]
Original file line number Diff line number Diff line change 4444 InverterData ,
4545)
4646from ...power import DistributionAlgorithm , InvBatPair
47+ from .request import Request
4748
4849_logger = logging .getLogger (__name__ )
4950
@@ -139,25 +140,6 @@ def is_broken(self, component_id: int) -> bool:
139140 return False
140141
141142
142- @dataclass
143- class Request :
144- """Request from the user."""
145-
146- # How much power to set
147- power : int
148- # In which batteries the power should be set
149- batteries : Set [int ]
150- # Timeout for the server to respond on the request.
151- request_timeout_sec : float = 5.0
152- # If True and requested power value is out of bound, then
153- # PowerDistributor will decrease the power to match the bounds and
154- # distribute only decreased power.
155- # If False and the requested power is out of bound, then
156- # PowerDistributor will not process this request and send result with status
157- # Result.Status.OUT_OF_BOUND.
158- adjust_power : bool = True
159-
160-
161143@dataclass
162144class Result :
163145 """Result on distribution request."""
Original file line number Diff line number Diff line change 1+ # License: MIT
2+ # Copyright © 2022 Frequenz Energy-as-a-Service GmbH
3+ """Definition of the user request."""
4+
5+ from dataclasses import dataclass
6+ from typing import Set
7+
8+
9+ @dataclass
10+ class Request :
11+ """Request from the user."""
12+
13+ # How much power to set
14+ power : int
15+ # In which batteries the power should be set
16+ batteries : Set [int ]
17+ # Timeout for the server to respond on the requests.
18+ request_timeout_sec : float = 5.0
19+ # If True and requested power value is above upper bound, then the power will be
20+ # decreased to match the bounds. Only the decreased power will be set.
21+ # If False and the requested power is above upper bound, then request won't
22+ # be processed. result.OutOfBound message will be send back to the user.
23+ adjust_power : bool = True
You can’t perform that action at this time.
0 commit comments