Update LightSwitch.java

added a boolean variable so the sate of the switch can be determined during runtime. I also made the motionevent to send the toggle command to the light switch.