Skip to content

Commit

Permalink
feat(ui): add cc version (#2158)
Browse files Browse the repository at this point in the history
Fixes #2147
  • Loading branch information
robertsLando authored Jan 10, 2022
1 parent 282f5b1 commit 83c4e42
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ export type Z2MValueId = {
isCurrentValue?: boolean
conf?: GatewayValue
allowManualEntry?: boolean
commandClassVersion?: number
} & TranslatedValueID

export type Z2MValueIdScene = Z2MValueId & {
Expand Down Expand Up @@ -3570,6 +3571,9 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
nodeId: zwaveNode.id,
commandClass: zwaveValue.commandClass,
commandClassName: zwaveValue.commandClassName,
commandClassVersion: zwaveNode
.getEndpoint(zwaveValue.endpoint)
.getCCVersion(zwaveValue.commandClass),
endpoint: zwaveValue.endpoint,
property: zwaveValue.property,
propertyName: zwaveValue.propertyName,
Expand Down
16 changes: 14 additions & 2 deletions src/components/nodes-table/NodeDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,26 @@ export default {
...mapGetters(['mqtt']),
commandGroups() {
if (this.node) {
const groups = { Configuration: [] }
const groups = {}
let addConfiguration = true
for (const v of this.node.values) {
const className = v.commandClassName
const className =
v.commandClassName + ' v' + v.commandClassVersion
if (!groups[className]) {
if (v.commandClassName === 'Configuration') {
addConfiguration = false
}
groups[className] = []
}
groups[className].push(v)
}
// add empty confgiguration CC group
if (addConfiguration) {
groups.Configuration = []
}
return groups
} else {
return {}
Expand Down

0 comments on commit 83c4e42

Please sign in to comment.