diff --git a/api/lib/Gateway.ts b/api/lib/Gateway.ts index 32afa9b6c06..56660bf5ae5 100644 --- a/api/lib/Gateway.ts +++ b/api/lib/Gateway.ts @@ -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']: @@ -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 ( diff --git a/api/lib/ZwaveClient.ts b/api/lib/ZwaveClient.ts index 65b42fd0186..611eed27b0d 100644 --- a/api/lib/ZwaveClient.ts +++ b/api/lib/ZwaveClient.ts @@ -467,6 +467,11 @@ export interface FwFile { export interface ZUIEndpoint { index: number label?: string + deviceClass: { + basic: number + generic: number + specific: number + } } export enum ZUIScheduleEntryLockMode { @@ -6007,6 +6012,11 @@ class ZwaveClient extends TypedEventEmitter { 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