Code for the WiFi powerswitch project