joystick#

Description#

A plugin to monitor joystick events.

Configuration#

joystick:
  # [Optional]
  # Polling interval in seconds (default: 0.025)
  # poll_interval: 0.025  # type=float

  # [Optional]
  # How long we should wait for any running
  # threads/processes to stop before exiting (default: 5 seconds).
  # stop_timeout: 5  # type=Optional[float]

  # [Optional]
  # If set to True then the plugin will not monitor
  # for new events. This is useful if you want to run a plugin in
  # stateless mode and only leverage its actions, without triggering any
  # events. Defaults to False.
  # disable_monitor: False  # type=bool

Triggered events#

Actions#

Module reference#

class platypush.plugins.joystick.JoystickPlugin(poll_interval: float = 0.025, **kwargs)[source]#

Bases: RunnablePlugin

A plugin to monitor joystick events.

__init__(poll_interval: float = 0.025, **kwargs)[source]#
Parameters:

poll_interval – Polling interval in seconds (default: 0.025)

main()[source]#

Implementation of the main loop of the plugin.

start()#

Start the plugin.

status() List[dict][source]#
Returns:

[
  {
    "device": {
      "name": "Xbox 360 Controller",
      "number": "Joystick number",
      "path": "/dev/input/event0",
      "protocol": "usb"
    },
    "state": {
      "a": 1,
      "b": 1,
      "back": 1,
      "down_dir_pad": 1,
      "left_bumper": 1,
      "left_dir_pad": 1,
      "left_joystick_x": 0.5,
      "left_joystick_y": 0.5,
      "left_thumb": 1,
      "left_trigger": 0.5,
      "right_bumper": 1,
      "right_dir_pad": 1,
      "right_joystick_x": 0.5,
      "right_joystick_y": 0.5,
      "right_thumb": 1,
      "right_trigger": 0.5,
      "start": 1,
      "up_dir_pad": 1,
      "x": 1,
      "y": 1
    }
  }
]

stop()[source]#

Stop the plugin.

wait_stop(timeout=None)#

Wait until a stop event is received.