Updated code to match the pilight daemon (development branch)