Beaglebone Black binary sensor (#5422)

* Configuration parameters defined

* Edge detection added

* Example configuration added and tipo corrected

* Comments updated, lint update

* Added check for input pull_mode

* Too long line

* trailing white space

* Configuration parameters defined

* Edge detection added

* Example configuration added and tipo corrected

* Comments updated, lint update

* Added check for input pull_mode

* Too long line

* trailing white space

* pylint disable import error

* read_input() changed to return boolean value, according changes in binary sensor

* example configuration in docstring changed to mention direct web link, pylint update

* read_input() updated according review
This commit is contained in:
Martin Vacula
2017-01-20 21:55:28 +01:00
committed by Paulus Schoutsen
parent 067e11ea5c
commit f4d2d69a5d
2 changed files with 90 additions and 1 deletions

View File

@@ -63,7 +63,7 @@ def read_input(pin):
"""Read a value from a GPIO."""
# pylint: disable=import-error,undefined-variable
import Adafruit_BBIO.GPIO as GPIO
return GPIO.input(pin)
return GPIO.input(pin) is GPIO.HIGH
def edge_detect(pin, event_callback, bounce):