Electronic Structure of Lanthanum Hydrides with Switchable Optical Properties