Docstring format

This commit is contained in:
arofarn 2021-06-27 20:18:20 +02:00
parent 045ce9724e
commit 199c76d4f5

View File

@ -164,6 +164,7 @@ class _TrellisKeypad:
class NeoTrellisM4:
"""
Driver for the Adafruit NeoTrellis.
:param left_part: if None (or ommitted) the class create a
neotrellis.multitrellis-compatible object for the left half of the
TrellisM4 board. Else le right part is created and the arguement
@ -234,9 +235,11 @@ class NeoTrellisM4:
def set_event(self, key, edge, enable):
"""
Control which kinds of events are set
:param int key: the key number
: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):
raise ValueError("event enable must be True or False")
@ -252,7 +255,9 @@ class NeoTrellisM4:
def read_keypad(self, num):
"""
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):
self._current_events.append(0xFF)
@ -281,6 +286,7 @@ class NeoTrellisM4:
def activate_key(self, key, edge, enable=True):
"""
Activate or deactivate a key on the trellis.
:param int key : key number from 0 to 16.
:param int edge : specifies what edge to register an event on and can be
NeoTrellis.EDGE_FALLING or NeoTrellis.EDGE_RISING.