mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Set WOL node to use more generic broadcast address byt default
This commit is contained in:
@@ -13,6 +13,10 @@ module.exports = function(RED) {
|
||||
this.on("input", function(msg) {
|
||||
var mac = this.mac || msg.mac || null;
|
||||
var host = this.host || msg.host || '255.255.255.255';
|
||||
var h = host.split('.');
|
||||
h.pop();
|
||||
h.push('255');
|
||||
host = h.join('.');
|
||||
if (mac != null) {
|
||||
if (chk.test(mac)) {
|
||||
try {
|
||||
@@ -35,7 +39,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
else { node.warn("WOL: no mac address specified"); }
|
||||
});
|
||||
|
||||
|
||||
this.on("close", function () {
|
||||
node.status({});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user