(session_id: str, name: str)
| 48 | |
| 49 | |
| 50 | async def trigger_pose(session_id: str, name: str) -> bool: |
| 51 | url = _control_url(session_id) |
| 52 | payload = {"event": "pose-trigger", "pose_trigger": {"name": name}} |
| 53 | timeout = aiohttp.ClientTimeout(total=30.0) |
| 54 | async with aiohttp.ClientSession(timeout=timeout) as session: |
| 55 | async with session.post( |
| 56 | url, |
| 57 | headers={ |
| 58 | "Content-Type": "application/json", |
| 59 | "X-API-Key": os.environ["LEMONSLICE_API_KEY"], |
| 60 | }, |
| 61 | json=payload, |
| 62 | ) as response: |
| 63 | return response.ok |
| 64 | |
| 65 | |
| 66 | @dataclass |
no test coverage detected