Make is_active a property

This commit is contained in:
Ben Nuttall
2015-09-14 21:29:39 +01:00
parent d11f9725e5
commit 5b99e69e9b

View File

@@ -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