def cleanup(self): """ Calls stop_crypto() if needed and cleanups GPIO. """ if self.authed: self.stop_crypto() GPIO.cleanup()