File tree 3 files changed +11
-5
lines changed
3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 5
5
< input type = "text" id = "node-input-mac" placeholder = "e.g. DE:AD:BE:EF:FE:ED" >
6
6
</ div >
7
7
< div class = "form-row" >
8
- < label for = "node-input-host" > < i class = "fa fa-globe" > </ i > Host Address</ label >
9
- < input type = "text" id = "node-input-host" placeholder = "e.g. 255.255.255.255" >
8
+ < label for = "node-input-host" > < i class = "fa fa-globe" > </ i > Target Address</ label >
9
+ < input type = "text" id = "node-input-host" placeholder = "e.g. 192.168.1. 255 or 10 .255.255.255" >
10
10
</ div >
11
11
< div class = "form-row" >
12
12
< label for = "node-input-name" > < i class = "fa fa-tag" > </ i > Name</ label >
18
18
< script type ="text/x-red " data-help-name ="wake on lan ">
19
19
< p > Sends a Wake-On-LAN magic packet to the mac address specified.</ p >
20
20
< p > You may instead set < code > msg . mac < / c o d e > t o d y n a m i c a l l y s e t t h e t a r g e t d e v i c e m a c t o w a k e u p .< / p>
21
- < p > The target host address can optionally be set using < code > msg.host</ code > </ p >
21
+ < p > The address of the target machine can optionally be set using < code > msg.host</ code > </ p >
22
+ < p > Setting the target address to the broadcast address of the subnet that the target machine is attached to works best .
23
+ For a class C address this is usually just the first three parts of the ip address followed by 255. eg 192.168 .1 .255 . < / p >
22
24
</ script >
23
25
24
26
< script type ="text/javascript ">
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ module.exports = function(RED) {
13
13
this . on ( "input" , function ( msg ) {
14
14
var mac = this . mac || msg . mac || null ;
15
15
var host = this . host || msg . host || '255.255.255.255' ;
16
+ var h = host . split ( '.' ) ;
17
+ h . pop ( ) ;
18
+ h . push ( '255' ) ;
19
+ host = h . join ( '.' ) ;
16
20
if ( mac != null ) {
17
21
if ( chk . test ( mac ) ) {
18
22
try {
@@ -35,7 +39,7 @@ module.exports = function(RED) {
35
39
}
36
40
else { node . warn ( "WOL: no mac address specified" ) ; }
37
41
} ) ;
38
-
42
+
39
43
this . on ( "close" , function ( ) {
40
44
node . status ( { } ) ;
41
45
} )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " node-red-node-wol" ,
3
- "version" : " 0.0.9 " ,
3
+ "version" : " 0.0.10 " ,
4
4
"description" : " A Node-RED node to send Wake-On-LAN (WOL) magic packets" ,
5
5
"dependencies" : {
6
6
"wake_on_lan" : " 1.0.0"
You can’t perform that action at this time.
0 commit comments