some tweaks from chris stanton
Merge branch 'master' of github.com:hamishcunningham/pi-gate