-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnode.js
More file actions
31 lines (29 loc) · 898 Bytes
/
node.js
File metadata and controls
31 lines (29 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import * as Info from "./info.js";
const socket = io("ws://localhost:8080");
const emitSocket = () => {
if (Info.getLed("yellow") && Info.getLed("green") && Info.getLed("red")) {
socket.emit('message', {"status" : "7"});
}
else if (Info.getLed("yellow") && Info.getLed("red")) {
socket.emit('message', {"status" : "6"});
}
else if (Info.getLed("green") && Info.getLed("red")) {
socket.emit('message', {"status" : "5"});
}
else if (Info.getLed("green") && Info.getLed("yellow")) {
socket.emit('message', {"status" : "4"});
}
else if (Info.getLed("red")) {
socket.emit('message', {"status" : "3"});
}
else if (Info.getLed("yellow")) {
socket.emit('message', {"status" : "2"});
}
else if (Info.getLed("green")) {
socket.emit('message', {"status" : "1"});
}
else {
socket.emit('message', {"status" : "0"});
}
}
export {emitSocket};