Skip to content

Commit

Permalink
Fix debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
bkbilly committed Apr 23, 2023
1 parent f1a7504 commit 1bca61e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions alarmcode/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def del_sensor(self):

def _checkInputPinState(self, inputPin):
nowState = GPIO.input(self.pin)
if nowState == 1:
time.sleep(0.2)
nowState = GPIO.input(self.pin)

if nowState == 1:
self._notify_alert(self.sensorName)
else:
Expand Down

0 comments on commit 1bca61e

Please # to comment.