-
Notifications
You must be signed in to change notification settings - Fork 0
/
EXT-Touch.js
61 lines (53 loc) · 1.37 KB
/
EXT-Touch.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
****************************
* Module : EXT-Touch
* Activate by touch for GA
* @bugsounet
* 2024-03-22
****************************
*/
/* global DetectorTouchVisual */
Module.register("EXT-Touch", {
requiresVersion: "2.26.0",
start () {
this.ready = false;
const Tools = {
file: (...args) => this.file(...args),
sendNotification: (...args) => this.sendNotification(...args)
};
this.Touch = new DetectorTouchVisual(Tools);
},
notificationReceived (notification, payload, sender) {
switch (notification) {
case "EXT_TOUCH-START":
if (this.ready) this.Touch.RefreshLogo(false);
break;
case "EXT_TOUCH-BLINK":
if (this.ready) this.Touch.RefreshLogo(true);
break;
case "EXT_TOUCH-STOP":
if (this.ready) this.Touch.Disabled();
break;
case "GA_READY":
if (sender.name === "MMM-GoogleAssistant") { this.sendSocketNotification("INIT"); }
break;
}
},
socketNotificationReceived (notification) {
switch (notification) {
case "INITIALIZED":
this.ready = true;
this.sendNotification("EXT_HELLO", this.name);
break;
}
},
getStyles () {
return [this.file("EXT-Touch.css")];
},
getScripts () {
return ["/modules/EXT-Touch/components/visual.js"];
},
getDom () {
return this.Touch.TouchDom();
}
});