Skip to content

Commit

Permalink
fix: better zwave valueid parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Dec 28, 2020
1 parent efab02e commit 967a28f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/ZwaveClient.js
Expand Up @@ -710,9 +710,13 @@ function parseValue (zwaveNode, zwaveValue, zwaveValueMeta) {

const vID = getValueID(valueId)

const prevValue = node.values[vID] ? node.values[vID].value : null
valueId.value =
zwaveValue.newValue || prevValue || zwaveNode.getValue(zwaveValue)
valueId.value = zwaveNode.getValue(zwaveValue)

if (valueId.value === undefined) {
const prevValue = node.values[vID] ? node.values[vID].value : undefined
valueId.value =
zwaveValue.newValue !== undefined ? zwaveValue.newValue : prevValue
}

if (isCurrentValue(valueId)) {
valueId.isCurrentValue = true
Expand Down

0 comments on commit 967a28f

Please sign in to comment.