@@ -4,73 +4,67 @@ import type { ModuleInstance } from './main.js'
44
55export function UpdateFeedbacks ( self : ModuleInstance ) : void {
66 self . setFeedbackDefinitions ( {
7- ' insightStatusDisconnected' : getChannelStatusFeedback ( 'insightStatusDisconnected' , 'Disconnected' , self ) ,
8- ' insightStatusPlay' : getChannelStatusFeedback ( 'insightStatusPlay' , 'Playing' , self ) ,
9- ' insightStatusCue' : getChannelStatusFeedback ( 'insightStatusCue' , 'Cued' , self ) ,
10- ' insightStatusStop' : getChannelStatusFeedback ( 'insightStatusStop' , 'Stopped' , self ) ,
11- ' insightChannelName' : getChannelNameFeedback ( 'insightChannelName' , self )
7+ insightStatusDisconnected : getChannelStatusFeedback ( 'insightStatusDisconnected' , 'Disconnected' , self ) ,
8+ insightStatusPlay : getChannelStatusFeedback ( 'insightStatusPlay' , 'Playing' , self ) ,
9+ insightStatusCue : getChannelStatusFeedback ( 'insightStatusCue' , 'Cued' , self ) ,
10+ insightStatusStop : getChannelStatusFeedback ( 'insightStatusStop' , 'Stopped' , self ) ,
11+ insightChannelName : getChannelNameFeedback ( 'insightChannelName' , self ) ,
1212 } )
1313}
1414
15- function getChannelStatusFeedback ( name : string , state : string , self : ModuleInstance ) : CompanionBooleanFeedbackDefinition
16- {
15+ function getChannelStatusFeedback (
16+ name : string ,
17+ state : string ,
18+ self : ModuleInstance ,
19+ ) : CompanionBooleanFeedbackDefinition {
1720 return {
1821 type : 'boolean' ,
1922 name : name ,
2023 description : '' ,
2124 defaultStyle : {
2225 bgcolor : combineRgb ( 255 , 255 , 255 ) ,
23- color : combineRgb ( 0 , 0 , 0 ) ,
26+ color : combineRgb ( 0 , 0 , 0 ) ,
2427 } ,
2528 options : [
26- {
27- type : 'textinput' ,
28- label : 'text' ,
29- id : 'text' ,
30- default : '' ,
31- useVariables : true
32- }
29+ {
30+ type : 'textinput' ,
31+ label : 'text' ,
32+ id : 'text' ,
33+ default : '' ,
34+ useVariables : true ,
35+ } ,
3336 ] ,
34- callback : ( feedback , context ) => {
35- return new Promise ( ( resolve , reject ) => {
36- reject ;
37- feedback ;
38- context ;
39- var val = self . getVariableValue ( 'channelStatus' ) as string ;
40- resolve ( val == state ) ;
37+ callback : async ( _feedback , _context ) => {
38+ return new Promise ( ( resolve , _reject ) => {
39+ const val = self . getVariableValue ( 'channelStatus' ) as string
40+ resolve ( val == state )
4141 } )
42- }
42+ } ,
4343 }
4444}
4545
46- function getChannelNameFeedback ( name : string , self : ModuleInstance ) : CompanionBooleanFeedbackDefinition
47- {
46+ function getChannelNameFeedback ( name : string , _self : ModuleInstance ) : CompanionBooleanFeedbackDefinition {
4847 return {
4948 type : 'boolean' ,
5049 name : name ,
5150 description : '' ,
5251 defaultStyle : {
5352 bgcolor : combineRgb ( 255 , 255 , 255 ) ,
54- color : combineRgb ( 0 , 0 , 0 ) ,
53+ color : combineRgb ( 0 , 0 , 0 ) ,
5554 } ,
5655 options : [
57- {
58- type : 'textinput' ,
59- label : 'text' ,
60- id : 'text' ,
61- default : '' ,
62- useVariables : true
63- }
56+ {
57+ type : 'textinput' ,
58+ label : 'text' ,
59+ id : 'text' ,
60+ default : '' ,
61+ useVariables : true ,
62+ } ,
6463 ] ,
65- callback : ( feedback , context ) => {
66- return new Promise ( ( resolve , reject ) => {
67- feedback ;
68- context ;
69- resolve ;
70- reject ;
71- self ;
72- return true ; // always returns true because notification is sent on name change only.
64+ callback : async ( _feedback , _context ) => {
65+ return new Promise ( ( _resolve , _reject ) => {
66+ return true // always returns true because notification is sent on name change only.
7367 } )
74- }
68+ } ,
7569 }
7670}
0 commit comments