From fc165282a9105f58d6e5e3327d28b74600b8b315 Mon Sep 17 00:00:00 2001 From: Naveed Jooma Date: Tue, 15 Oct 2024 12:07:19 -0400 Subject: [PATCH] Fix await docs --- src/viam/components/servo/servo.py | 2 +- src/viam/resource/base.py | 2 +- src/viam/robot/client.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/viam/components/servo/servo.py b/src/viam/components/servo/servo.py index 8c8621a56..453cf1c30 100644 --- a/src/viam/components/servo/servo.py +++ b/src/viam/components/servo/servo.py @@ -103,7 +103,7 @@ async def is_moving(self) -> bool: my_servo = Servo.from_robot(robot=robot, name="my_servo") - print(my_servo.is_moving()) + print(await my_servo.is_moving()) Returns: diff --git a/src/viam/resource/base.py b/src/viam/resource/base.py index d9dbc5b40..56a08e0c7 100644 --- a/src/viam/resource/base.py +++ b/src/viam/resource/base.py @@ -76,7 +76,7 @@ async def do_command( :: command = {"cmd": "test", "data1": 500} - result = component.do(command) + result = await component.do_command(command) Args: command (Mapping[str, ValueTypes]): The command to execute diff --git a/src/viam/robot/client.py b/src/viam/robot/client.py index 2e6ec5d99..ff86cddd8 100644 --- a/src/viam/robot/client.py +++ b/src/viam/robot/client.py @@ -829,7 +829,7 @@ async def get_cloud_metadata(self) -> GetCloudMetadataResponse: :: - metadata = machine.get_cloud_metadata() + metadata = await machine.get_cloud_metadata() print(metadata.machine_id) print(metadata.machine_part_id) print(metadata.primary_org_id) @@ -854,7 +854,7 @@ async def shutdown(self): :: - machine.shutdown() + await machine.shutdown() Raises: GRPCError: Raised with DeadlineExceeded status if shutdown request times out, or if @@ -890,7 +890,7 @@ async def get_version(self) -> GetVersionResponse: :: - result = machine.get_version() + result = await machine.get_version() print(result.platform) print(result.version) print(result.api_version)