Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add an sdkVersion property for nodes #4371

Merged
merged 1 commit into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/api/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,14 @@ declare enum ProtocolVersion {
}
```

### `sdkVersion`

```ts
readonly sdkVersion: string
```

The version of the Z-Wave SDK this node's firmware is built with.

### `firmwareVersion`

```ts
Expand Down
7 changes: 7 additions & 0 deletions packages/zwave-js/src/lib/commandclass/VersionCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ export function getFirmwareVersionsMetadata(): ValueMetadata {
};
}

export function getSDKVersionValueId(): ValueID {
return {
commandClass: CommandClasses.Version,
property: "sdkVersion",
};
}

export enum VersionCommand {
Get = 0x11,
Report = 0x12,
Expand Down
9 changes: 8 additions & 1 deletion packages/zwave-js/src/lib/node/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ import {
SecurityCCNonceGet,
SecurityCCNonceReport,
} from "../commandclass/SecurityCC";
import { getFirmwareVersionsValueId } from "../commandclass/VersionCC";
import {
getFirmwareVersionsValueId,
getSDKVersionValueId,
} from "../commandclass/VersionCC";
import {
getWakeUpIntervalValueId,
getWakeUpOnDemandSupportedValueId,
Expand Down Expand Up @@ -682,6 +685,10 @@ export class ZWaveNode extends Endpoint implements SecurityClassOwner {
return this.getValue<string[]>(getFirmwareVersionsValueId())?.[0];
}

public get sdkVersion(): string | undefined {
return this.getValue(getSDKVersionValueId());
}

public get zwavePlusVersion(): number | undefined {
return this.getValue(getZWavePlusVersionValueId());
}
Expand Down