mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
bump wake on lan package
This commit is contained in:
@@ -17,9 +17,13 @@ module.exports = function(RED) {
|
||||
if (chk.test(mac)) {
|
||||
try {
|
||||
wol.wake(mac, {address: host}, function(error) {
|
||||
if (error) { node.warn(error); }
|
||||
if (error) {
|
||||
node.warn(error);
|
||||
node.status({fill:"red",shape:"ring",text:" "});
|
||||
}
|
||||
else if (RED.settings.verbose) {
|
||||
node.log("sent WOL magic packet");
|
||||
node.status({fill:"green",shape:"dot",text:" "});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -31,6 +35,10 @@ module.exports = function(RED) {
|
||||
}
|
||||
else { node.warn("WOL: no mac address specified"); }
|
||||
});
|
||||
|
||||
this.on("close", function () {
|
||||
node.status({});
|
||||
})
|
||||
}
|
||||
RED.nodes.registerType("wake on lan",WOLnode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user