Skip to content

Commit 880e1c5

Browse files
committed
Replace uses Selected.value with Selected.message
This field was renamed in the channel release v1.0.0-rc1. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent d2d4386 commit 880e1c5

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/frequenz/sdk/actor/_power_managing/_power_managing_actor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ async def _run(self) -> None:
195195
drop_old_proposals_timer,
196196
):
197197
if selected_from(selected, self._proposals_receiver):
198-
proposal = selected.value
198+
proposal = selected.message
199199
if proposal.component_ids not in self._bound_tracker_tasks:
200200
self._add_bounds_tracker(proposal.component_ids)
201201

@@ -214,7 +214,7 @@ async def _run(self) -> None:
214214
await self._send_reports(proposal.component_ids)
215215

216216
elif selected_from(selected, self._bounds_subscription_receiver):
217-
sub = selected.value
217+
sub = selected.message
218218
component_ids = sub.component_ids
219219
priority = sub.priority
220220

@@ -239,7 +239,7 @@ async def _run(self) -> None:
239239
power_distributing,
240240
)
241241

242-
result = selected.value
242+
result = selected.message
243243
self._distribution_results[frozenset(result.request.component_ids)] = (
244244
result
245245
)

src/frequenz/sdk/actor/power_distributing/_component_status/_battery_status_tracker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,13 @@ async def _run(
277277
new_status = None
278278

279279
if selected_from(selected, battery):
280-
self._handle_status_battery(selected.value)
280+
self._handle_status_battery(selected.message)
281281

282282
elif selected_from(selected, inverter):
283-
self._handle_status_inverter(selected.value)
283+
self._handle_status_inverter(selected.message)
284284

285285
elif selected_from(selected, set_power_result):
286-
self._handle_status_set_power_result(selected.value)
286+
self._handle_status_set_power_result(selected.message)
287287

288288
elif selected_from(selected, battery_timer):
289289
if (

src/frequenz/sdk/timeseries/ev_charger_pool/_set_current_bounds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async def _run(self) -> None:
110110
raise ValueError("Meter channel closed.")
111111

112112
if selected_from(selected, bound_chan):
113-
bound: ComponentCurrentLimit = selected.value
113+
bound: ComponentCurrentLimit = selected.message
114114
if (
115115
bound.component_id in latest_bound
116116
and latest_bound[bound.component_id] == bound

tests/actor/test_actor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ async def _run(self) -> None:
141141
channel_2 = self._recv2
142142

143143
async for selected in select(channel_1, channel_2):
144-
print(f"{self} received message {selected.value!r}")
144+
print(f"{self} received message {selected.message!r}")
145145
if selected_from(selected, channel_1):
146146
print(f"{self} sending message received from channel_1")
147-
await self._output.send(selected.value)
147+
await self._output.send(selected.message)
148148
elif selected_from(selected, channel_2):
149149
print(f"{self} sending message received from channel_2")
150-
await self._output.send(selected.value)
150+
await self._output.send(selected.message)
151151

152152
print(f"{self} done (should not happen)")
153153

0 commit comments

Comments
 (0)