mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
Make is_active a property
This commit is contained in:
@@ -18,6 +18,7 @@ class InputDevice(object):
|
|||||||
self.inactive = 1
|
self.inactive = 1
|
||||||
GPIO.setup(pin, GPIO.IN, self.pull)
|
GPIO.setup(pin, GPIO.IN, self.pull)
|
||||||
|
|
||||||
|
@property
|
||||||
def is_active(self):
|
def is_active(self):
|
||||||
return GPIO.input(self.pin) == self.active
|
return GPIO.input(self.pin) == self.active
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user