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

Add support for zwave-js 8.5.0 #415

Merged
merged 2 commits into from
Oct 13, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,17 @@ interface {
}
```

#### [Get defined value IDs](https://zwave-js.github.io/node-zwave-js/#/api/virtual-node-endpoint?id=getdefinedvalueids)

[compatible with schema version: 11+]

```ts
interface {
messageId: string;
command: "<prefix>.get_defined_value_ids"
}
```

## Events

### `zwave-js` Events
Expand Down
154 changes: 77 additions & 77 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"ws": "^8.0.0"
},
"peerDependencies": {
"zwave-js": "^8.4.1"
"zwave-js": "^8.5.0"
},
"devDependencies": {
"@types/minimist": "^1.2.1",
Expand All @@ -42,7 +42,7 @@
"prettier": "^2.3.0",
"ts-node": "^10.0.0",
"typescript": "^4.1.3",
"zwave-js": "^8.4.1",
"zwave-js": "^8.5.0",
"alcalzone-shared": "^4.0.0"
},
"husky": {
Expand Down
1 change: 1 addition & 0 deletions src/lib/broadcast_node/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export enum BroadcastNodeCommand {
getCCVersion = "broadcast_node.get_cc_version",
invokeCCAPI = "broadcast_node.invoke_cc_api",
supportsCCAPI = "broadcast_node.supports_cc_api",
getDefinedValueIDs = "multicast_group.get_defined_value_ids",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add this to the readme?

}
8 changes: 7 additions & 1 deletion src/lib/broadcast_node/incoming_message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@ export interface IncomingCommandBroadcastNodeSupportsCCAPI
commandClass: CommandClasses;
}

export interface IncomingCommandBroadcastNodeGetDefinedValueIDs
extends IncomingCommandBroadcastNodeBase {
command: BroadcastNodeCommand.getDefinedValueIDs;
}

export type IncomingMessageBroadcastNode =
| IncomingCommandBroadcastNodeSetValue
| IncomingCommandBroadcastNodeGetEndpointCount
| IncomingCommandBroadcastNodeSupportsCC
| IncomingCommandBroadcastNodeGetCCVersion
| IncomingCommandBroadcastNodeInvokeCCAPI
| IncomingCommandBroadcastNodeSupportsCCAPI;
| IncomingCommandBroadcastNodeSupportsCCAPI
| IncomingCommandBroadcastNodeGetDefinedValueIDs;
3 changes: 3 additions & 0 deletions src/lib/broadcast_node/message_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export class BroadcastNodeMessageHandler {
message.index
).supportsCCAPI(message.commandClass);
return { supported };
case BroadcastNodeCommand.getDefinedValueIDs:
const valueIDs = virtualNode.getDefinedValueIDs();
return { valueIDs };
default:
throw new UnknownCommandError(command);
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/broadcast_node/outgoing_message.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { VirtualValueID } from "zwave-js/lib/node/VirtualNode";
import { BroadcastNodeCommand } from "./command";

export interface BroadcastNodeResultTypes {
Expand All @@ -7,4 +8,5 @@ export interface BroadcastNodeResultTypes {
[BroadcastNodeCommand.getCCVersion]: { version: number };
[BroadcastNodeCommand.invokeCCAPI]: { response: unknown };
[BroadcastNodeCommand.supportsCCAPI]: { supported: boolean };
[BroadcastNodeCommand.getDefinedValueIDs]: { valueIDs: VirtualValueID[] };
}
1 change: 1 addition & 0 deletions src/lib/multicast_group/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export enum MulticastGroupCommand {
getCCVersion = "multicast_group.get_cc_version",
invokeCCAPI = "multicast_group.invoke_cc_api",
supportsCCAPI = "multicast_group.supports_cc_api",
getDefinedValueIDs = "multicast_group.get_defined_value_ids",
}
8 changes: 7 additions & 1 deletion src/lib/multicast_group/incoming_message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ export interface IncomingCommandMulticastGroupSupportsCCAPI
commandClass: CommandClasses;
}

export interface IncomingCommandBroadcastNodeGetDefinedValueIDs
extends IncomingCommandMulticastGroupBase {
command: MulticastGroupCommand.getDefinedValueIDs;
}

export type IncomingMessageMulticastGroup =
| IncomingCommandMulticastGroupSetValue
| IncomingCommandMulticastGroupGetEndpointCount
| IncomingCommandMulticastGroupSupportsCC
| IncomingCommandMulticastGroupGetCCVersion
| IncomingCommandMulticastGroupInvokeCCAPI
| IncomingCommandMulticastGroupSupportsCCAPI;
| IncomingCommandMulticastGroupSupportsCCAPI
| IncomingCommandBroadcastNodeGetDefinedValueIDs;
3 changes: 3 additions & 0 deletions src/lib/multicast_group/message_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export class MulticastGroupMessageHandler {
message.index
).supportsCCAPI(message.commandClass);
return { supported };
case MulticastGroupCommand.getDefinedValueIDs:
const valueIDs = virtualNode.getDefinedValueIDs();
return { valueIDs };
default:
throw new UnknownCommandError(command);
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/multicast_group/outgoing_message.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { VirtualValueID } from "zwave-js/lib/node/VirtualNode";
import { MulticastGroupCommand } from "./command";

export interface MulticastGroupResultTypes {
Expand All @@ -7,4 +8,5 @@ export interface MulticastGroupResultTypes {
[MulticastGroupCommand.getCCVersion]: { version: number };
[MulticastGroupCommand.invokeCCAPI]: { response: unknown };
[MulticastGroupCommand.supportsCCAPI]: { supported: boolean };
[MulticastGroupCommand.getDefinedValueIDs]: { valueIDs: VirtualValueID[] };
}