The lights were on in the room.

Literal

Room [in-には] lights [subject-が] was-on.

ついていた is the past resulting-state form of the intransitive つく (to turn on).