From f677c79f54b333163cf5cb26417f6d58857b47e9 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 1 Dec 2018 19:38:43 +0100 Subject: [PATCH] Made inactivity timeout on Wiimote configurable --- platypush/backend/wiimote.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platypush/backend/wiimote.py b/platypush/backend/wiimote.py index 03044602d..82242b265 100644 --- a/platypush/backend/wiimote.py +++ b/platypush/backend/wiimote.py @@ -34,6 +34,16 @@ class WiimoteBackend(Backend): _last_btn_event_time = 0 + def __init__(self, inactivity_timeout=_inactivity_timeout, *args, **kwargs): + """ + :param inactivity_timeout: Number of seconds elapsed from the last Wiimote action before disconnecting the device (default: 300 seconds) + :type inactivity_timeout: float + """ + + super().__init__(*args, **kwargs) + self._inactivity_timeout = inactivity_timeout + + def get_wiimote(self): if not self._wiimote: self._wiimote = cwiid.Wiimote()