Docstring format
This commit is contained in:
parent
045ce9724e
commit
199c76d4f5
@ -164,6 +164,7 @@ class _TrellisKeypad:
|
|||||||
class NeoTrellisM4:
|
class NeoTrellisM4:
|
||||||
"""
|
"""
|
||||||
Driver for the Adafruit NeoTrellis.
|
Driver for the Adafruit NeoTrellis.
|
||||||
|
|
||||||
:param left_part: if None (or ommitted) the class create a
|
:param left_part: if None (or ommitted) the class create a
|
||||||
neotrellis.multitrellis-compatible object for the left half of the
|
neotrellis.multitrellis-compatible object for the left half of the
|
||||||
TrellisM4 board. Else le right part is created and the arguement
|
TrellisM4 board. Else le right part is created and the arguement
|
||||||
@ -234,9 +235,11 @@ class NeoTrellisM4:
|
|||||||
def set_event(self, key, edge, enable):
|
def set_event(self, key, edge, enable):
|
||||||
"""
|
"""
|
||||||
Control which kinds of events are set
|
Control which kinds of events are set
|
||||||
|
|
||||||
:param int key: the key number
|
:param int key: the key number
|
||||||
:param int edge: the type of event
|
:param int edge: the type of event
|
||||||
:param bool enable: True to enable the event, False to disable it"""
|
:param bool enable: True to enable the event, False to disable it
|
||||||
|
"""
|
||||||
|
|
||||||
if enable not in (True, False):
|
if enable not in (True, False):
|
||||||
raise ValueError("event enable must be True or False")
|
raise ValueError("event enable must be True or False")
|
||||||
@ -252,7 +255,9 @@ class NeoTrellisM4:
|
|||||||
def read_keypad(self, num):
|
def read_keypad(self, num):
|
||||||
"""
|
"""
|
||||||
Read data from the keypad
|
Read data from the keypad
|
||||||
:param int num: The number of bytes to read"""
|
|
||||||
|
:param int num: The number of bytes to read
|
||||||
|
"""
|
||||||
|
|
||||||
while num > len(self._current_events):
|
while num > len(self._current_events):
|
||||||
self._current_events.append(0xFF)
|
self._current_events.append(0xFF)
|
||||||
@ -281,6 +286,7 @@ class NeoTrellisM4:
|
|||||||
def activate_key(self, key, edge, enable=True):
|
def activate_key(self, key, edge, enable=True):
|
||||||
"""
|
"""
|
||||||
Activate or deactivate a key on the trellis.
|
Activate or deactivate a key on the trellis.
|
||||||
|
|
||||||
:param int key : key number from 0 to 16.
|
:param int key : key number from 0 to 16.
|
||||||
:param int edge : specifies what edge to register an event on and can be
|
:param int edge : specifies what edge to register an event on and can be
|
||||||
NeoTrellis.EDGE_FALLING or NeoTrellis.EDGE_RISING.
|
NeoTrellis.EDGE_FALLING or NeoTrellis.EDGE_RISING.
|
||||||
|
Loading…
Reference in New Issue
Block a user