Skip to content

Commit

Permalink
fix: undefined deviceConfig error
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Nov 16, 2020
1 parent a1f67ec commit d8a26da
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/ZwaveClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,14 +564,20 @@ function initNode (zwaveNode) {

const node = this.nodes[nodeId]

const deviceConfig = zwaveNode.deviceConfig || {
label: 'Unknown product ' + zwaveNode.productId,
description: zwaveNode.productType,
manufacturer: 'Unknown manufacturer ' + zwaveNode.manufacturerId
}

// https://zwave-js.github.io/node-zwave-js/#/api/node?id=zwavenode-properties
node.manufacturerId = zwaveNode.manufacturerId
node.productId = zwaveNode.productId
node.productLabel = zwaveNode.deviceConfig.label
node.productDescription = zwaveNode.deviceConfig.description
node.productLabel = deviceConfig.label
node.productDescription = deviceConfig.description
node.productType = zwaveNode.productType
node.manufacturerId = zwaveNode.manufacturerId
node.manufacturer = zwaveNode.deviceConfig.manufacturer
node.manufacturer = deviceConfig.manufacturer
node.firmwareVersion = zwaveNode.firmwareVersion
node.zwaveVersion = zwaveNode.version
node.isSecure = zwaveNode.isSecure
Expand Down

0 comments on commit d8a26da

Please sign in to comment.