def lock(self):
        """Lock the device."""
        success = self.set_status(CONST.STATUS_LOCKCLOSED_INT)

        if success:
            self._json_state['status'] = CONST.STATUS_LOCKCLOSED

        return success
Lock the device.