Skip to content

Instantly share code, notes, and snippets.

@voipnorm
Created September 23, 2019 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voipnorm/14ac43a34abe3e406b86a8043ad6122a to your computer and use it in GitHub Desktop.
Save voipnorm/14ac43a34abe3e406b86a8043ad6122a to your computer and use it in GitHub Desktop.
tp.on('status', (report) => {
console.log(report);
if(report.state === 'lights'){
if(report.status === 'on'){
lights(true);
}else{
lights(false);
}
}else{
//Dimmer still to be done
if(report.status === 'increment'){
console.log("dimmer up");
//to be done
}else{
console.log("dimmer down");
//to be done
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment