Skip to content

Commit c7a5f84

Browse files
authored
Fix await docs (#768)
1 parent d9852a6 commit c7a5f84

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/viam/components/servo/servo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ async def is_moving(self) -> bool:
103103
104104
my_servo = Servo.from_robot(robot=robot, name="my_servo")
105105
106-
print(my_servo.is_moving())
106+
print(await my_servo.is_moving())
107107
108108
109109
Returns:

src/viam/resource/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def do_command(
7676
::
7777
7878
command = {"cmd": "test", "data1": 500}
79-
result = component.do(command)
79+
result = await component.do_command(command)
8080
8181
Args:
8282
command (Mapping[str, ValueTypes]): The command to execute

src/viam/robot/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ async def get_cloud_metadata(self) -> GetCloudMetadataResponse:
829829
830830
::
831831
832-
metadata = machine.get_cloud_metadata()
832+
metadata = await machine.get_cloud_metadata()
833833
print(metadata.machine_id)
834834
print(metadata.machine_part_id)
835835
print(metadata.primary_org_id)
@@ -854,7 +854,7 @@ async def shutdown(self):
854854
855855
::
856856
857-
machine.shutdown()
857+
await machine.shutdown()
858858
859859
Raises:
860860
GRPCError: Raised with DeadlineExceeded status if shutdown request times out, or if
@@ -890,7 +890,7 @@ async def get_version(self) -> GetVersionResponse:
890890
891891
::
892892
893-
result = machine.get_version()
893+
result = await machine.get_version()
894894
print(result.platform)
895895
print(result.version)
896896
print(result.api_version)

0 commit comments

Comments
 (0)