-
-
Save tobie/4e438781ebf8d7980af9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//client side, thing is a remote lightbulb | |
var lightbulb = new Lightbulb(); | |
lightbulb.onchange = e => { | |
console.log("Ligthbulb " + e.src + " changed state at " + e.time + " to " + e.dim); | |
}; | |
lightbulb.requestData() | |
.then(function(data) { | |
console.log("current power consumption is " + data.power + " Watts"); | |
}) | |
.catch(function(err) { | |
console.err(err), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment