request_action()
  • 1 Minute to read

request_action()


Article summary

Opens a window on the fleet manager to ask for an action from a person.

Reference

Arguments

ArgumentsTypeDefault valueDescription
titlestrTitle to show on the window
messagestrMessage to show on the window
task_idstrNoneTask id generated by the fleet manager
timeoutfloat30.0Timeout to wait for a response, if there is no response raise RayaFleetTimeout

Return

dict

Exceptions

  • RayaFleetWrongValue
  • RayaFleetTimeout

See the complete list of fleet exceptions

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


Was this article helpful?

What's Next