Skip to content

Commit 6baf8ef

Browse files
committed
Change pylint-ified
1 parent 7a34681 commit 6baf8ef

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

adafruit_circuitplayground/circuit_playground_base.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,39 +184,42 @@ def detect_taps(self, value):
184184
value, 60, time_limit=10, time_latency=50, time_window=255
185185
)
186186

187+
# pylint: disable-msg=too-many-arguments
188+
# Many default arguments which will probably not need changing in most cases
187189
def configure_taps(
188190
self,
189191
value,
190-
range=adafruit_lis3dh.RANGE_8_G,
192+
accel_range=adafruit_lis3dh.RANGE_8_G,
191193
theshold=None,
192194
time_limit=None,
193195
time_latency=50,
194196
time_window=255,
195197
):
196-
""" A way to customize the tap detection better. The default values don't work for all cases.
198+
""" A way to customize the tap detection better. The default values don't work
199+
for all cases.
197200
Higher default thresholds for the CPB
198201
"""
199202
if value < 0 or value > 2:
200203
return
201204

202-
if range not in [
205+
if accel_range not in [
203206
adafruit_lis3dh.RANGE_2_G,
204207
adafruit_lis3dh.RANGE_4_G,
205208
adafruit_lis3dh.RANGE_8_G,
206209
adafruit_lis3dh.RANGE_16_G,
207210
]:
208-
range = adafruit_lis3dh.RANGE_8_G
209-
self._lis3dh.range = range
211+
accel_range = adafruit_lis3dh.RANGE_8_G
212+
self._lis3dh.range = accel_range
210213

211214
if value == 1:
212-
if theshold == None or theshold < 0 or theshold > 127:
215+
if theshold is None or theshold < 0 or theshold > 127:
213216
theshold = 100 if "nRF52840" in os.uname().machine else 90
214-
if time_limit == None:
217+
if time_limit is None:
215218
time_limit = 4
216219
elif value == 2:
217-
if theshold == None or theshold < 0 or theshold > 127:
220+
if theshold is None or theshold < 0 or theshold > 127:
218221
theshold = 70 if "nRF52840" in os.uname().machine else 60
219-
if time_limit == None:
222+
if time_limit is None:
220223
time_limit = 10
221224
else:
222225
# sane values for turning the tap detection off
@@ -230,6 +233,7 @@ def configure_taps(
230233
time_latency=time_latency,
231234
time_window=time_window,
232235
)
236+
# pylint: enable-msg=too-many-arguments
233237

234238
@property
235239
def tapped(self):

0 commit comments

Comments
 (0)