Hallway lights

I got tired of changing batteries to keep the motion activated light at the top of the stairs working. I opened the battery powered light and soldered wires from a left over plug transformer to the circuit board. The transformer plugs in under the stairs where the IT equipment lives. No that I know it works, I can use the technique in the lights inside the custom copper enclosures I built. I would like to keep the light focused on the stairs and not up in the eyes.