Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for name issue raised in #170 #172

Merged
merged 4 commits into from
Nov 7, 2019
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/HAPBridgeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function(RED) {
this.allowInsecureRequest = config.allowInsecureRequest !== undefined ? config.allowInsecureRequest : false

this.allowMessagePassthrough = config.allowMessagePassthrough !== undefined ? config.allowMessagePassthrough : false

this.manufacturer = config.manufacturer
this.serialNo = config.serialNo
this.model = config.model
Expand Down Expand Up @@ -157,6 +157,6 @@ module.exports = function(RED) {

function macify(nodeId) {
const noDecimalStr = nodeId.replace('.', '')
Shaquu marked this conversation as resolved.
Show resolved Hide resolved
const paddedStr = noDecimalStr.padStart(16, '0')
Shaquu marked this conversation as resolved.
Show resolved Hide resolved
return paddedStr.match(/.{1,2}/g).join(':')
const paddedStr = noDecimalStr.padEnd(12, '0')
return paddedStr.match(/.{1,2}/g).join(':').substr(0, 17).toUpperCase()
}