File tree Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 14
14
"signalk-notification-" : " signalk-notification.js" ,
15
15
"signalk-filter-delta" : " signalk-filter-delta.js" ,
16
16
"signalk-send-delta" : " signalk-send-delta.js" ,
17
- "signalk-send-pathvalue" : " signalk-send-pathvalue.js"
17
+ "signalk-send-pathvalue" : " signalk-send-pathvalue.js" ,
18
+ "signalk-send-put" : " signalk-send-put.js"
18
19
}
19
20
}
20
21
}
Original file line number Diff line number Diff line change
1
+ < script type ="text/javascript ">
2
+ RED . nodes . registerType ( 'signalk-send-put' , {
3
+ category : 'output' ,
4
+ color : '#a6bbcf' ,
5
+ defaults : {
6
+ name : { value :"" } ,
7
+ path : { value :"" }
8
+ } ,
9
+ inputs :1 ,
10
+ outputs :0 ,
11
+ icon : "bridge.png" ,
12
+ align : 'right' ,
13
+ label : function ( ) {
14
+ return this . name || "signalk-send-put" ;
15
+ }
16
+ } ) ;
17
+ </ script >
18
+
19
+ < script type ="text/x-red " data-template-name ="signalk-send-put ">
20
+ < div class = "form-row" >
21
+ < label for = "node-input-name" > < i class = "icon-tag" > </ i > Name</ label >
22
+ < input type = "text" id = "node-input-name" placeholder = "Name" >
23
+ </ div >
24
+ < div class = "form-row" >
25
+ < label for = "node-input-path" > < i class = "icon-tag" > </ i > Path</ label >
26
+ < input type = "text" id = "node-input-path" placeholder = "Path" >
27
+ </ div >
28
+ </ script >
29
+
30
+ < script type ="text/x-red " data-help-name ="signalk-send-put ">
31
+ < p > A simple node that converts the message payloads into all lower-case characters</ p >
32
+ </ script >
Original file line number Diff line number Diff line change
1
+
2
+ module . exports = function ( RED ) {
3
+ function signalKSendPut ( config ) {
4
+ RED . nodes . createNode ( this , config ) ;
5
+ var node = this ;
6
+
7
+ var app = node . context ( ) . global . get ( 'app' )
8
+
9
+ node . on ( 'input' , msg => {
10
+ node . log ( `setting ${ config . path } to ${ msg . payload } ` )
11
+ app . putSelfPath ( config . path , msg . payload )
12
+ } )
13
+ }
14
+ RED . nodes . registerType ( "signalk-send-put" , signalKSendPut ) ;
15
+ }
You can’t perform that action at this time.
0 commit comments