Skip to content

Commit

Permalink
fix: Undefined this in deviceInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Mar 2, 2020
1 parent 3fe61ba commit d33f0a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ Gateway.prototype.discoverDevice = function (node, hassDevice) {
const nodeName = getNodeName(node)

// Set device information using node info
payload.device = deviceInfo(node, nodeName)
payload.device = deviceInfo.call(this, node, nodeName)

// Set a friendly name for this component
payload.name = `${nodeName}_${hassDevice.object_id}`
Expand Down Expand Up @@ -997,7 +997,7 @@ Gateway.prototype.discoverValue = function (node, valueId) {
}

// Set device information using node info
payload.device = deviceInfo(node, nodeName)
payload.device = deviceInfo.call(this, node, nodeName)

// multi instance devices would have same object_id
if (valueId.instance > 1) cfg.object_id += '_' + valueId.instance
Expand Down

0 comments on commit d33f0a1

Please sign in to comment.