diff --git a/packages/cc/src/cc/VersionCC.ts b/packages/cc/src/cc/VersionCC.ts index b41d6c99ae6e..31d02fb5135d 100644 --- a/packages/cc/src/cc/VersionCC.ts +++ b/packages/cc/src/cc/VersionCC.ts @@ -582,7 +582,7 @@ export class VersionCC extends CommandClass { direction: "outbound", }); // Basic CC is not included in the NIF, so it won't be returned by endpoint.getCCs() at this point - { + if (applHost.maySupportBasicCC(node.id)) { const cc = CommandClasses.Basic; // Skip the query of endpoint CCs that are also supported by the root device if (this.endpointIndex === 0 || node.getCCVersion(cc) === 0) { diff --git a/packages/host/src/ZWaveHost.ts b/packages/host/src/ZWaveHost.ts index 6455c7bc71e1..b5e300622b9c 100644 --- a/packages/host/src/ZWaveHost.ts +++ b/packages/host/src/ZWaveHost.ts @@ -112,6 +112,9 @@ export interface ZWaveApplicationHost extends ZWaveHost { /** Readonly access to all node instances known to the host */ nodes: ReadonlyThrowingMap; + /** Whether a node or endpoint may support the Basic CC */ + maySupportBasicCC(nodeId: number, endpointIndex?: number): boolean; + /** Whether the node with the given ID is the controller */ isControllerNode(nodeId: number): boolean; diff --git a/packages/host/src/mocks.ts b/packages/host/src/mocks.ts index ca42be0f4850..079042239183 100644 --- a/packages/host/src/mocks.ts +++ b/packages/host/src/mocks.ts @@ -132,6 +132,9 @@ export function createTestingHost( schedulePoll: (_nodeId, _valueId, _options) => { return false; }, + maySupportBasicCC: (_nodeId, _endpointIndex) => { + return true; + }, }; return ret; } diff --git a/packages/zwave-js/src/lib/driver/Driver.ts b/packages/zwave-js/src/lib/driver/Driver.ts index 23364bed5cde..466d3d55091d 100644 --- a/packages/zwave-js/src/lib/driver/Driver.ts +++ b/packages/zwave-js/src/lib/driver/Driver.ts @@ -926,6 +926,18 @@ export class Driver extends TypedEventEmitter return this.controller.nodes.get(nodeId)?.deviceConfig; } + /** + * **!!! INTERNAL !!!** + * + * Not intended to be used by applications + */ + public maySupportBasicCC(nodeId: number, endpointIndex?: number): boolean { + const deviceClass = this.controller.nodes.get(nodeId)?.getEndpoint( + endpointIndex ?? 0, + )?.deviceClass; + return deviceClass?.specific.maySupportBasicCC ?? true; + } + public getHighestSecurityClass( nodeId: number, ): MaybeNotKnown {