generated from bitfocus/companion-module-template-js
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfeedbacks.js
55 lines (49 loc) · 1.34 KB
/
feedbacks.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
import { combineRgb } from '@companion-module/base'
export function getFeedbacks() {
const feedbacks = {}
const ColorWhite = combineRgb(255, 255, 255)
const ColorBlack = combineRgb(0, 0, 0)
const ColorGray = combineRgb(110, 110, 110)
const ColorRed = combineRgb(200, 0, 0)
const ColorGreen = combineRgb(0, 200, 0)
const ColorOrange = combineRgb(255, 102, 0)
let eventStatusChoices = [
{ id: 'running', label: 'Running' },
{ id: 'pending', label: 'Pending' },
{ id: 'complete', label: 'Complete' },
{ id: 'error', label: 'Error' },
{ id: 'preprocessing', label: 'Preprocessing' },
{ id: 'postprocessing', label: 'Postprocessing' },
]
let systemStatusChoices = [
{ id: 'green_status', label: 'Running' },
{ id: 'orange_status', label: 'Pending' },
]
feedbacks['eventStatus'] = {
type: 'boolean',
name: 'Live Event Status',
description: "Change style if an event's current status matches the selected status",
defaultStyle: {
bgcolor: ColorGreen,
},
options: [
{
type: 'number',
label: 'Event ID',
id: 'id',
default: '',
},
{
type: 'dropdown',
label: 'Status',
id: 'status',
default: 'running',
choices: eventStatusChoices,
},
],
callback: (feedback) => {
return this.live_events?.[`${feedback.options.id}`]?.status === feedback.options.status
},
}
return feedbacks
}