request_action()¶
Opens a window on the fleet manager to ask for an action from a person.
Reference¶
Arguments¶
Arguments |
Type |
Default value |
Description |
|---|---|---|---|
title |
str |
Title to show on the window |
|
message |
str |
Message to show on the window |
|
task_id |
str |
None |
Task id generated by the fleet manager |
timeout |
float |
30.0 |
Timeout to wait for a response,
if there is no response raise
|
Return¶
dict
Exceptions¶
RayaFleetWrongValueRayaFleetTimeout
Usage Example¶
from raya.application_base import RayaApplicationBase
from raya.controllers.fleet_controller import FleetController
class RayaApplication(RayaApplicationBase):
async def setup(self):
self.fleet: FleetController = await self.enable_controller('fleet')
async def loop(self):
response = await self.fleet.request_action(
title='Move to target',
message='Gary wants to move to the target',
timeout=120.0
)
self.log.info(response)
self.finish_app()
async def finish(self):
pass