It's a nice idea, but I'm afraid it isn't possible... At least at the moment reading from the light sensor requires an analog to digital conversion, which can't be done without waking the device up - and if it's awake it's not that painful to get JS to do the reading for you.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi,
It's a nice idea, but I'm afraid it isn't possible... At least at the moment reading from the light sensor requires an analog to digital conversion, which can't be done without waking the device up - and if it's awake it's not that painful to get JS to do the reading for you.