You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.js
+34-29Lines changed: 34 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ instance.prototype.init = function () {
30
30
self.nodes=[]
31
31
self.currentChannel=''
32
32
self.accessToken=''
33
-
33
+
34
34
self.setupVariables()
35
35
self.getAccessToken()
36
36
self.getNodes()
@@ -72,7 +72,8 @@ instance.prototype.config_fields = function () {
72
72
id: 'info',
73
73
width: 12,
74
74
label: 'Information',
75
-
value: 'This module is for the Adder XDIP Receiver. Add a new module connection for each receiver in your system. The Receiver Access Password is required to change channels.',
75
+
value:
76
+
'This module is for the Adder XDIP Receiver. Add a new module connection for each receiver in your system. The Receiver Access Password is required to change channels.',
76
77
},
77
78
{
78
79
type: 'textinput',
@@ -150,7 +151,7 @@ instance.prototype.action = function (action) {
150
151
self.switchChannel(cmd)
151
152
self.getCurrentChannel()
152
153
}else{
153
-
self.log('warn','Unable to find channel number for '+opt.channelUuid)
154
+
self.log('warn','Unable to find channel number for '+opt.channelUuid)
154
155
}
155
156
break
156
157
}
@@ -189,7 +190,7 @@ instance.prototype.switchChannel = function (cmd) {
189
190
190
191
if(self.accessToken==''){
191
192
console.log('missing access token')
192
-
self.log('warn','Unable to switch channel, missing access token')
193
+
self.log('warn','Unable to switch channel, missing access token')
193
194
return
194
195
}
195
196
@@ -213,13 +214,14 @@ instance.prototype.switchChannel = function (cmd) {
213
214
self.status(self.STATUS_OK)
214
215
}else{
215
216
console.log('error '+result.response.statusCode)
216
-
self.log('warn','Unable to switch to channel')
217
+
self.log('warn','Unable to switch to channel')
217
218
}
218
219
},
219
220
header,
220
-
{connection: {
221
-
rejectUnauthorized: false,
222
-
}
221
+
{
222
+
connection: {
223
+
rejectUnauthorized: false,
224
+
},
223
225
}
224
226
)
225
227
}
@@ -262,9 +264,10 @@ instance.prototype.getChannels = function () {
262
264
}
263
265
},
264
266
header,
265
-
{connection: {
266
-
rejectUnauthorized: false,
267
-
}
267
+
{
268
+
connection: {
269
+
rejectUnauthorized: false,
270
+
},
268
271
}
269
272
)
270
273
}
@@ -278,7 +281,7 @@ instance.prototype.getNodes = function () {
278
281
varheader=[]
279
282
header['Content-Type']='application/json'
280
283
console.log(cmd)
281
-
284
+
282
285
self.system.emit(
283
286
'rest_get',
284
287
cmd,
@@ -297,7 +300,7 @@ instance.prototype.getNodes = function () {
297
300
if(name.length==0){
298
301
name='Name not set! '+i
299
302
}
300
-
description=result.data[i].description.trim()
303
+
description=result.data[i].description.trim()
301
304
// console.log(uuid)
302
305
//if (uuid != 'self') {
303
306
self.nodes.splice(i,0,{
@@ -316,9 +319,10 @@ instance.prototype.getNodes = function () {
316
319
}
317
320
},
318
321
header,
319
-
{connection: {
320
-
rejectUnauthorized: false,
321
-
}
322
+
{
323
+
connection: {
324
+
rejectUnauthorized: false,
325
+
},
322
326
}
323
327
)
324
328
}
@@ -363,17 +367,18 @@ instance.prototype.getCurrentChannel = function () {
0 commit comments