Code to run on a Particle.io hardware device to act as the main light switch for my home automation system.