As far as I can see, if you send ledState/status=0, the RGB LED goes off and the imp will idle until you subsequently send ledState/status=1. If you are continuing to read light values - presumably you are seeing this in the log - then sensor is not zero when it is called.
I would power-cycle your imp manually to make sure it has the latest version of your software if you have not done this.
Couple of observations:
The imp.configure line is no longer necessary - remove it.
The setTime() function doesn’t need the ‘if…’ statement. If you want the LEDs to turn off, you just send a non-zero time value which can be used by imp.wakeup. Are you ever going to send a zero value?
my main problem is the light sensor, this is why my program does not do what i want. and i dont’t know what i have to modify at my readSensor function to make the program work.
what I have to modify at my readSensor() function, I want to make my light sensor to read values and to send them to my RGB Led. At the moment that function reads only a value and then it’s not reading another value.