Skip to content

Commit

Permalink
fix(discovery): use valueId endpoint device class for multilevel swit…
Browse files Browse the repository at this point in the history
…ch CC discovery (#3877)
  • Loading branch information
robertsLando authored Sep 6, 2024
1 parent 5040e7e commit a467854
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/lib/Gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,10 @@ export default class Gateway {

const cmdClass = valueId.commandClass

const deviceClass =
node.endpoints[valueId.endpoint]?.deviceClass ??
node.deviceClass

switch (cmdClass) {
case CommandClasses['Binary Switch']:
case CommandClasses['All Switch']:
Expand All @@ -1256,8 +1260,8 @@ export default class Gateway {
if (valueId.isCurrentValue) {
const specificDeviceClass =
Constants.specificDeviceClass(
node.deviceClass.generic,
node.deviceClass.specific,
deviceClass.generic,
deviceClass.specific,
)
// Use a cover_position configuration if ...
if (
Expand Down
10 changes: 10 additions & 0 deletions api/lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,11 @@ export interface FwFile {
export interface ZUIEndpoint {
index: number
label?: string
deviceClass: {
basic: number
generic: number
specific: number
}
}

export enum ZUIScheduleEntryLockMode {
Expand Down Expand Up @@ -6007,6 +6012,11 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
return {
index: e.index,
label: e.endpointLabel || defaultLabel,
deviceClass: {
basic: e.deviceClass?.basic,
generic: e.deviceClass?.generic.key,
specific: e.deviceClass?.specific.key,
},
}
})
node.isSecure = zwaveNode.isSecure
Expand Down

0 comments on commit a467854

Please sign in to comment.