I believe that all electrics have to be on for a compass swing - I'm sure someone will correct me if I'm wrong.
The general opinion appears to be that the effect of electrical equipment on the compass should be small enough that, even with all electrics switched off, the change in deviation will be negligable. But I've also heard people tell of specific incidents where there would be one particular piece of equipment which would affect the deviation by 5 or 10 degrees on certain headings. I'd suggest that, if you've been flying an aircraft for a while without problems, what you're doing is fine. If you switch to a new aircraft and find yourself constantly off course, a cheap option, before having the compass re-swung, might be to try flying with everything turned on, just to eliminate the possibility that there is a big change in deviation.
I find it hard to believe that lights would affect the deviation perceptably. Certainly the cases I've heard of have related to nav/com equipment, and not to lights. But this sounds like exactly the type of statement which is just waiting for someone to come and prove me wrong!
FFF
----------