Updated sensor.py. Fixed repeated sensor triggers.