From d767cafafe2759f4b77b227385a55974dfec1413 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 15 May 2021 23:48:17 +0200 Subject: [PATCH] `joystick.jstest` should actually run the parent `run` method but not extend `JoystickBackend` --- platypush/backend/joystick/jstest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platypush/backend/joystick/jstest.py b/platypush/backend/joystick/jstest.py index 1f6997c0..d4d2a54d 100644 --- a/platypush/backend/joystick/jstest.py +++ b/platypush/backend/joystick/jstest.py @@ -5,7 +5,7 @@ import subprocess import time from typing import Optional, List -from platypush.backend.joystick import JoystickBackend +from platypush.backend import Backend from platypush.message.event.joystick import JoystickConnectedEvent, JoystickDisconnectedEvent, JoystickStateEvent, \ JoystickButtonPressedEvent, JoystickButtonReleasedEvent, JoystickAxisEvent @@ -40,7 +40,7 @@ class JoystickState: } -class JoystickJstestBackend(JoystickBackend): +class JoystickJstestBackend(Backend): """ This backend can be used to intercept events from a joystick device if the device does not work with the standard :class:`platypush.backend.joystick.JoystickBackend` backend (this may especially happen with some Bluetooth @@ -89,6 +89,7 @@ class JoystickJstestBackend(JoystickBackend): """ super().__init__(device=device, **kwargs) + self.device = device self.jstest_path = jstest_path self._process: Optional[subprocess.Popen] = None self._state: Optional[JoystickState] = None @@ -235,6 +236,8 @@ class JoystickJstestBackend(JoystickBackend): self._state = state def run(self): + super().run() + try: while not self.should_stop(): self._wait_ready()