Skip to content

Commit

Permalink
fix: correctly parse valueMetadata states when not defined
Browse files Browse the repository at this point in the history
Fixes #1758
  • Loading branch information
robertsLando committed Sep 29, 2021
1 parent 831dc93 commit 4e8f61b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3197,7 +3197,11 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
).maxLength
}

if (utils.hasProperty(zwaveValueMeta, 'states')) {
if (
(zwaveValueMeta as ValueMetadataNumeric).states &&
Object.keys((zwaveValueMeta as ValueMetadataNumeric).states)
.length > 0
) {
valueId.list = true
valueId.allowManualEntry = (
zwaveValueMeta as ConfigurationMetadata
Expand Down

0 comments on commit 4e8f61b

Please sign in to comment.