Set WOL node to use more generic broadcast address byt default

This commit is contained in:
Dave Conway-Jones
2018-12-09 11:01:18 +00:00
parent 7113598098
commit 73e4ae574c
3 changed files with 11 additions and 5 deletions

View File

@@ -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({});
})