@@ -184,39 +184,42 @@ def detect_taps(self, value):
184
184
value , 60 , time_limit = 10 , time_latency = 50 , time_window = 255
185
185
)
186
186
187
+ # pylint: disable-msg=too-many-arguments
188
+ # Many default arguments which will probably not need changing in most cases
187
189
def configure_taps (
188
190
self ,
189
191
value ,
190
- range = adafruit_lis3dh .RANGE_8_G ,
192
+ accel_range = adafruit_lis3dh .RANGE_8_G ,
191
193
theshold = None ,
192
194
time_limit = None ,
193
195
time_latency = 50 ,
194
196
time_window = 255 ,
195
197
):
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.
197
200
Higher default thresholds for the CPB
198
201
"""
199
202
if value < 0 or value > 2 :
200
203
return
201
204
202
- if range not in [
205
+ if accel_range not in [
203
206
adafruit_lis3dh .RANGE_2_G ,
204
207
adafruit_lis3dh .RANGE_4_G ,
205
208
adafruit_lis3dh .RANGE_8_G ,
206
209
adafruit_lis3dh .RANGE_16_G ,
207
210
]:
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
210
213
211
214
if value == 1 :
212
- if theshold == None or theshold < 0 or theshold > 127 :
215
+ if theshold is None or theshold < 0 or theshold > 127 :
213
216
theshold = 100 if "nRF52840" in os .uname ().machine else 90
214
- if time_limit == None :
217
+ if time_limit is None :
215
218
time_limit = 4
216
219
elif value == 2 :
217
- if theshold == None or theshold < 0 or theshold > 127 :
220
+ if theshold is None or theshold < 0 or theshold > 127 :
218
221
theshold = 70 if "nRF52840" in os .uname ().machine else 60
219
- if time_limit == None :
222
+ if time_limit is None :
220
223
time_limit = 10
221
224
else :
222
225
# sane values for turning the tap detection off
@@ -230,6 +233,7 @@ def configure_taps(
230
233
time_latency = time_latency ,
231
234
time_window = time_window ,
232
235
)
236
+ # pylint: enable-msg=too-many-arguments
233
237
234
238
@property
235
239
def tapped (self ):
0 commit comments