Assume that you have a device that receives its power from the main 120 or 220V-ac line and you need to add a switch between the ac line and the device so that the device works only when it is dark.