Code for the Home Automation with the Raspberry Pi book