What is going on inside this nightlight circuit?
There must be some comparator with hysteresis, preventing the light from turning on and off when the light is at an intermediate level.

But, when the light is in this middle state and somebody covers it, it remains on instead of turning off. A solution could be to set it for turning on with a lower amount of light, so then a simple shadow or cloudy day won't turn it on.

There should also be a screw that allows you to regulate this threshold. Can you help us identifying the type of light\sensor?