If $y = (x - 1)^{2} + ax + \sin\left(x + \frac{\pi}{2}\right)$ is an even function, then $a =$ $\_\_\_\_$ .