def _callback(m, channel): if m['led'] == 1: if led == 0: led_on() print 'LED ON' if m['led'] == 0: if led == 1: led_off() print 'LED OFF' if m['lock'] == 1: if lock == 0: lock = 1 doorservo.lock() print 'DOOR LOCKED' if m['lock'] == 0: if lock == 1: lock = 0 doorservo.unlock() print 'DOOR UNLOCKED'
def _callback(m, channel): if m['led'] == 1: if led == 0: led_on() print 'LED ON' if m['led'] == 0: if led == 1: led_off() print 'LED OFF' if m['lock'] == 1: if lock == 0 lock = 1 doorservo.lock() print 'DOOR LOCKED' if m['lock'] == 0: if lock == 1: lock = 0 doorservo.unlock() print 'DOOR UNLOCKED'