@@ -156,7 +156,7 @@ async def get_controls(self, *, extra: Optional[Dict[str, Any]] = None, timeout:
156
156
157
157
# Get the controller from the machine.
158
158
my_controller = Controller.from_robot(
159
- myRobotWithController , "my_controller")
159
+ robot=machine , "my_controller")
160
160
161
161
# Get the list of Controls provided by the controller.
162
162
controls = await my_controller.get_controls()
@@ -183,7 +183,7 @@ async def get_events(
183
183
184
184
# Get the controller from the machine.
185
185
my_controller = Controller.from_robot(
186
- myRobotWithController , "my_controller")
186
+ robot=machine , "my_controller")
187
187
188
188
# Get the most recent Event for each Control.
189
189
recent_events = await my_controller.get_events()
@@ -247,7 +247,7 @@ async def main():
247
247
248
248
# Get your controller from the machine.
249
249
my_controller = Controller.from_robot(
250
- myRobotWithController , "my_controller")
250
+ robot=machine , "my_controller")
251
251
252
252
# Run the handleController function.
253
253
await handle_controller(my_controller)
@@ -276,12 +276,13 @@ async def trigger_event(
276
276
"""Directly send an Event (such as a button press) from external code
277
277
278
278
::
279
+
279
280
my_controller = Controller.from_robot(
280
281
robot=machine, name="my_controller")
281
282
282
283
# Get your controller from the machine.
283
284
my_controller = Controller.from_robot(
284
- myRobotWithController , "my_controller")
285
+ robot=machine , "my_controller")
285
286
286
287
# Define a "Button is Pressed" event for the control BUTTON_START.
287
288
button_is_pressed_event = Event(
0 commit comments