diff --git a/lib/HAPBridgeNode.js b/lib/HAPBridgeNode.js index 4f19906f..375b76b7 100644 --- a/lib/HAPBridgeNode.js +++ b/lib/HAPBridgeNode.js @@ -28,7 +28,7 @@ module.exports = function(RED) { config.allowMessagePassthrough !== undefined ? config.allowMessagePassthrough : false - + this.manufacturer = config.manufacturer this.serialNo = config.serialNo this.model = config.model @@ -163,6 +163,6 @@ module.exports = function(RED) { function macify(nodeId) { const noDecimalStr = nodeId.replace('.', '') - const paddedStr = noDecimalStr.padStart(16, '0') - return paddedStr.match(/.{1,2}/g).join(':') + const paddedStr = noDecimalStr.padEnd(12, '0') + return paddedStr.match(/.{1,2}/g).join(':').substr(0, 17).toUpperCase() }