-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfeedbacks.js
More file actions
38 lines (36 loc) · 1004 Bytes
/
feedbacks.js
File metadata and controls
38 lines (36 loc) · 1004 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
32
33
34
35
36
37
38
import { combineRgb } from "@companion-module/base";
async function updateFeedbacks(self) {
self.setFeedbackDefinitions({
socket_state: {
name: "Socket State",
type: "boolean",
label: "Socket State",
description: "Indicates if the socket is on or off",
defaultStyle: {
bgcolor: combineRgb(0, 255, 0),
color: combineRgb(0, 0, 0),
},
options: [
{
id: "socket",
type: "number",
label: "Socket Number",
default: 1,
min: 1,
max: 4,
},
],
callback: (feedback) => {
const variableId = `p${feedback.options.socket}`;
const currentState = self.getVariableValue(variableId);
self.log(
"debug",
`Feedback callback for socket ${feedback.options.socket}, state: ${currentState}`
);
//return currentState === '1';
return currentState === "On";
},
},
});
}
export { updateFeedbacks };