疲れていたので、電気をつけた___寝てしまいました。
Q. What does つけたまま express?
Translation
I was so tired I fell asleep with the light still on.
Explanation
〜たまま expresses an unchanged state continuing during another action: つけたまま寝た 'slept with it on'. The light was turned on and left that way — not turned off.