From 5b99e69e9b77c2467af39d7eadcb45e0d4276da1 Mon Sep 17 00:00:00 2001 From: Ben Nuttall Date: Mon, 14 Sep 2015 21:29:39 +0100 Subject: [PATCH] Make is_active a property --- gpio_components/input_devices.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gpio_components/input_devices.py b/gpio_components/input_devices.py index 28295ed..f586d6b 100644 --- a/gpio_components/input_devices.py +++ b/gpio_components/input_devices.py @@ -18,6 +18,7 @@ class InputDevice(object): self.inactive = 1 GPIO.setup(pin, GPIO.IN, self.pull) + @property def is_active(self): return GPIO.input(self.pin) == self.active