mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Slight tweak to Wake on Lan (WOL) node
This commit is contained in:
parent
88e89e7232
commit
03484169e3
@ -23,7 +23,7 @@
|
|||||||
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
||||||
<input type="text" id="node-input-name" placeholder="Name">
|
<input type="text" id="node-input-name" placeholder="Name">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-tips">Tip: leave blank if you want to use <b>msg.mac</b></div>
|
<div class="form-tips">Tip: leave blank if you want to use <b>msg.mac</b> to dynamically set target mac address.</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/x-red" data-help-name="wake on lan">
|
<script type="text/x-red" data-help-name="wake on lan">
|
||||||
|
@ -20,7 +20,7 @@ var chk = /^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$/;
|
|||||||
|
|
||||||
function WOLnode(n) {
|
function WOLnode(n) {
|
||||||
RED.nodes.createNode(this,n);
|
RED.nodes.createNode(this,n);
|
||||||
this.mac = n.mac
|
this.mac = n.mac.trim();
|
||||||
var node = this;
|
var node = this;
|
||||||
|
|
||||||
this.on("input", function(msg) {
|
this.on("input", function(msg) {
|
||||||
@ -32,7 +32,7 @@ function WOLnode(n) {
|
|||||||
if (error) { node.warn(error); }
|
if (error) { node.warn(error); }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else { node.warn("WOL: bad mac address "+mac); }
|
else { node.warn('WOL: bad mac address "'+mac+'"'); }
|
||||||
}
|
}
|
||||||
else { node.warn("WOL: no mac address specified"); }
|
else { node.warn("WOL: no mac address specified"); }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user