shake on your light?

This would require an accelerometer. The use of an accelerometer is used in flashlights and is also discussed here: Sticking an accelerometer on a driver?
Interesting read. Biggest challenge is for the software to see the difference between an input signal (someone wants the light to turn on), and noise (the light is in a bag and is being shaken). But I haven’t read about a light that switches on and off by shaking it.