Skip to content

Commit 027cc89

Browse files
authored
Update input.py (#786)
1 parent b630e05 commit 027cc89

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/viam/components/input/input.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ async def get_controls(self, *, extra: Optional[Dict[str, Any]] = None, timeout:
156156
157157
# Get the controller from the machine.
158158
my_controller = Controller.from_robot(
159-
myRobotWithController, "my_controller")
159+
robot=machine, "my_controller")
160160
161161
# Get the list of Controls provided by the controller.
162162
controls = await my_controller.get_controls()
@@ -183,7 +183,7 @@ async def get_events(
183183
184184
# Get the controller from the machine.
185185
my_controller = Controller.from_robot(
186-
myRobotWithController, "my_controller")
186+
robot=machine, "my_controller")
187187
188188
# Get the most recent Event for each Control.
189189
recent_events = await my_controller.get_events()
@@ -247,7 +247,7 @@ async def main():
247247
248248
# Get your controller from the machine.
249249
my_controller = Controller.from_robot(
250-
myRobotWithController, "my_controller")
250+
robot=machine, "my_controller")
251251
252252
# Run the handleController function.
253253
await handle_controller(my_controller)
@@ -276,12 +276,13 @@ async def trigger_event(
276276
"""Directly send an Event (such as a button press) from external code
277277
278278
::
279+
279280
my_controller = Controller.from_robot(
280281
robot=machine, name="my_controller")
281282
282283
# Get your controller from the machine.
283284
my_controller = Controller.from_robot(
284-
myRobotWithController, "my_controller")
285+
robot=machine, "my_controller")
285286
286287
# Define a "Button is Pressed" event for the control BUTTON_START.
287288
button_is_pressed_event = Event(

0 commit comments

Comments
 (0)