forked from platypush/platypush
Removed legacy wiimote plugin
This commit is contained in:
parent
b30dc7ddb5
commit
d415d65bff
4 changed files with 0 additions and 82 deletions
|
@ -1,6 +0,0 @@
|
|||
``wiimote``
|
||||
=============================
|
||||
|
||||
.. automodule:: platypush.plugins.wiimote
|
||||
:members:
|
||||
|
|
@ -145,7 +145,6 @@ Plugins
|
|||
platypush/plugins/weather.buienradar.rst
|
||||
platypush/plugins/weather.openweathermap.rst
|
||||
platypush/plugins/websocket.rst
|
||||
platypush/plugins/wiimote.rst
|
||||
platypush/plugins/xmpp.rst
|
||||
platypush/plugins/youtube.rst
|
||||
platypush/plugins/zeroconf.rst
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
import time
|
||||
|
||||
from platypush.context import get_backend
|
||||
from platypush.plugins import Plugin, action
|
||||
|
||||
|
||||
class WiimotePlugin(Plugin):
|
||||
"""
|
||||
WiiMote plugin.
|
||||
A wrapper around the :mod:`platypush.backend.wiimote` backend to
|
||||
programmatically control a Nintendo WiiMote.
|
||||
|
||||
It requires the WiiMote backend to be enabled.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def _get_wiimote(cls):
|
||||
return get_backend('wiimote').get_wiimote()
|
||||
|
||||
@action
|
||||
def connect(self):
|
||||
"""
|
||||
Connects to the WiiMote
|
||||
"""
|
||||
self._get_wiimote()
|
||||
|
||||
@action
|
||||
def close(self):
|
||||
"""
|
||||
Closes the connection with the WiiMote
|
||||
"""
|
||||
get_backend('wiimote').close()
|
||||
|
||||
@action
|
||||
def rumble(self, secs):
|
||||
"""
|
||||
Rumbles the controller for the specified number of seconds
|
||||
"""
|
||||
wm = self._get_wiimote()
|
||||
wm.rumble = True
|
||||
time.sleep(secs)
|
||||
wm.rumble = False
|
||||
|
||||
@action
|
||||
def state(self):
|
||||
"""
|
||||
Return the state of the controller
|
||||
"""
|
||||
return get_backend('wiimote').get_state()
|
||||
|
||||
@action
|
||||
def set_leds(self, leds):
|
||||
"""
|
||||
Set the LEDs state on the controller
|
||||
|
||||
:param leds: Iterable with the new states to be applied to the LEDs.
|
||||
Example: [1, 0, 0, 0] or (False, True, False, False)
|
||||
:type leds: list
|
||||
"""
|
||||
|
||||
new_led = 0
|
||||
for i, led in enumerate(leds):
|
||||
if led:
|
||||
new_led |= 1 << i
|
||||
|
||||
self._get_wiimote().led = new_led
|
||||
|
||||
|
||||
# vim:sw=4:ts=4:et:
|
|
@ -1,6 +0,0 @@
|
|||
manifest:
|
||||
events: {}
|
||||
install:
|
||||
pip: []
|
||||
package: platypush.plugins.wiimote
|
||||
type: plugin
|
Loading…
Reference in a new issue