Commit 427e5eb
committed
Send power distribution results from the component manager
Until now, the PowerDistributingActor has supported only distributing
power to batteries. Batteries are (supposed to be) always available,
so the distribution takes place once when the power distributor
receives a request.
This changes when distributing power to EV chargers, because power
needs to be:
- distributed when an EV is connected
- redistributed to other EVs when an EV is disconnected
- redistributed to other EVs if an EV appears to be not charging, etc.
So a power distribution manager for EVs would be best implemented with
its own `select` loop, where distribution happens.
Because of this, a call to the `distribute_power` method on the EV
charger manager can't immediately return a single distribution result,
but that call is not the only thing that triggers the distribution,
but other events too.
So the manager needs to be what sends out the distribution results.
Signed-off-by: Sahas Subramanian <[email protected]>1 parent b1249e1 commit 427e5eb
File tree
3 files changed
+23
-12
lines changed- src/frequenz/sdk/actor/power_distributing
- _component_managers
3 files changed
+23
-12
lines changedLines changed: 16 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
130 | 131 | | |
131 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
132 | 142 | | |
133 | 143 | | |
134 | 144 | | |
| |||
181 | 191 | | |
182 | 192 | | |
183 | 193 | | |
184 | | - | |
| 194 | + | |
185 | 195 | | |
186 | 196 | | |
187 | 197 | | |
188 | 198 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | 199 | | |
193 | 200 | | |
194 | 201 | | |
195 | | - | |
196 | | - | |
197 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
198 | 206 | | |
199 | 207 | | |
200 | 208 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | | - | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
110 | | - | |
111 | | - | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
0 commit comments