Skip to content

Commit cc6e85e

Browse files
committed
Update component selector example
fixes #68 Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent a0358ad commit cc6e85e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/frequenz/dispatch/_managing_actor.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ async def _run(self) -> None:
6262
6363
def set_components(self, components: TargetComponents) -> None:
6464
match components:
65-
case [int(), *_] as component_ids:
66-
print("Dispatch: Setting components to %s", components)
65+
case []:
66+
print("Dispatch: Using all components")
67+
case list() as ids if isinstance(ids[0], int):
68+
component_ids = ids
6769
case [ComponentCategory.BATTERY, *_]:
68-
print("Dispatch: Using all battery components")
70+
component_category = ComponentCategory.BATTERY
6971
case unsupported:
7072
print(
71-
"Dispatch: Requested an unsupported target component %r, "
73+
"Dispatch: Requested an unsupported selector %r, "
7274
"but only component IDs or category BATTERY are supported.",
7375
unsupported,
7476
)

0 commit comments

Comments
 (0)