Flickering or pulstating Headlights

New chapter to my electrical soap opera. When I first purchased the car it had a plug in the coolant temp sending unit hole, I purchased a new sending unit it never worked. Took the car out today the first time after replacing the light switch, bingo the temp gauge started working, dah???