Large deviation principle for the maximal eigenvalue of inhomogeneous Erd\H{o}s-R\'enyi random graphs