from gpiozero import DigitalOutputDevice
class Lock(DigitalOutputDevice):
def __init__(self,*args,**kwargs):
if 'active_high' in kwargs:
raise TypeError("active_high not supported")
super().__init__(*args,**kwargs)
def lock(self):
super().on()
def unlock(self):
super().off()
def on(self):
raise AttributeError("'Lock' object has no attribute 'on'")
def off(self):
raise AttributeError("'Lock' object has no attribute 'off'")
def blink(self):
raise AttributeError("'Lock' object has no attribute 'blink'")