Doesn't 灯 also mean lamp?
That is how the word originated. Lamps/lanterns were the only source of light, but later on electricity and electric lights got invented. Chinese just used the same word for a light source from before and applied it to the new electric lights.
Just like the English, this can have many meanings depending on context: where is the light coming from, where is the light bulb, where is the light fixture, where is the light switch?
Depending on the context. Right