Using photocells in lighting