Skip to content

Commit

Permalink
Merge pull request #779 from kyrogon/patch-1
Browse files Browse the repository at this point in the history
Clearer error message for invalid bounce values
  • Loading branch information
waveform80 committed Mar 1, 2021
2 parents 399f470 + 3665dd9 commit a9850a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gpiozero/pins/pigpio.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ def _get_bounce(self):
def _set_bounce(self, value):
if value is None:
value = 0
elif value < 0:
raise PinInvalidBounce('bounce must be 0 or greater')
elif not 0 <= value <= 0.3:
raise PinInvalidBounce('bounce must be between 0 and 0.3')
self.factory.connection.set_glitch_filter(self.number, int(value * 1000000))

def _get_edges(self):
Expand Down

0 comments on commit a9850a8

Please sign in to comment.