Got ticketed for flashing lights to warn other motorists of mobile speed camera, I believe this ticket was unfair

Got a ticket for flashing my lights at other motorists to warn of a mobile speed camera, the cop said the ticket would be for "unnecessary use of lights", his words not mine. It seems to be a bit of a grey area legally and past statements police spokespeople have stated that it isn't illegal, but discouraged.