var Ws = requre(ws);
var ws = new Ws('wss://<host>/email/uid/device');
ws.on('open', function open() {
// Will send current state (all pin status)
ws.send('Yay!');
});
ws.on('message', function incoming(data) {
var data = JSON.stringify(data);
/*
data.command -> GET or SET
data.pin -> The corresponding pin
data.value -> The value to set, present when data.command is SET
*/
// have fun with data.
});
daveamit / olympus-ws Goto Github PK
View Code? Open in Web Editor NEWSocket server for Olympus home IoTs
License: GNU General Public License v3.0