Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let ws = new WebSocket(socketUrl)
ws.on("open", function open() {
console.log("Connected 🚀")
});
ws.on("message", function incoming(data) {
const parsed = JSON.parse(data)
const message = parsed.payload
const light = message.light
const status = parseInt(message.status)
if (light === "front") {
lights.front = lights.front ? 0 : 1
frontLeft.writeSync(lights.front)
frontRight.writeSync(lights.front)
updateStatus("front", lights.front)
console.log("front lights")
}
}
.
.
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.