Automatic headlight failure

My 2002 Sable auto headlights didn’t come on last night so I just turned them on with the manual switch. About 10 minutes later, while driving, I tried the auto switch agian and the lights came on but then they switched themselves off again in a few seconds. Should I just give up the auto mode?

Either that or replace the light sensor or LCM, whichever is the problem.