from gpiozero import DigitalInputDevice
class Door(DigitalInputDevice):
def __init__(self, pin=None, pull_up=True, active_state=None,
bounce_time=None, pin_factory=None):
super(Door, self).__init__(
pin, pull_up=pull_up, active_state=active_state,
bounce_time=bounce_time, pin_factory=pin_factory)
@property
def value(self):
return super(Door, self).value
Door.is_closed = Door.is_active
Door.when_open = Door.when_deactivated
Door.when_closed = Door.when_activated
Door.wait_for_open = Door.wait_for_inactive
Door.wait_for_close = Door.wait_for_active