-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_async.py
More file actions
32 lines (23 loc) · 857 Bytes
/
Copy pathexample_async.py
File metadata and controls
32 lines (23 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import asyncio
import sys
from pathlib import Path
_repo_src = Path(__file__).resolve().parent / "src"
if _repo_src.exists():
sys.path.insert(0, str(_repo_src))
from pyritone import Client
async def main() -> None:
async with Client() as client:
print(await client.ping())
print(await client.status_get())
# Settings API (async handle methods)
print(await client.settings.allowPlace.set(True))
print(await client.settings.allowPlace.get())
# print(await client.settings.allowPlace.toggle())
# print(await client.settings.allowPlace.reset())
dispatch = await client.goto(100, 70, 100)
print(dispatch)
task_id = dispatch.get("task_id")
if task_id:
print(await client.wait_for_task(task_id))
if __name__ == "__main__":
asyncio.run(main())