feat: add schema 47 controller, node, and endpoint commands (3/4)#1513
Merged
Conversation
2 tasks
4da184d to
0dde50c
Compare
There was a problem hiding this comment.
Pull request overview
This PR expands zwave-js-server’s WebSocket API to schema 47 by adding a large set of controller/node/endpoint commands (plus supporting state/event/serialization infrastructure) to align with newer Z-Wave JS capabilities.
Changes:
- Add many new schema 47 controller commands (routing, NVM, RF region, join/leave, diagnostics, associations, firmware update queries) plus schema 47 controller events.
- Add schema 47 node link reliability check commands + progress event, and schema 47 endpoint query commands.
- Improve payload handling/compatibility: Map JSON serialization, shared firmware file parsing (incl. ZIP extraction fallback), schema/version bumps, docs/CI updates.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/util/stringify.ts | Adds Map-to-object conversion in JSON stringify replacer (also keeps Uint8Array→Buffer JSON behavior). |
| src/test/integration.ts | Updates integration expected state to include schema 47 driver properties. |
| src/mock/index.ts | Extends mock driver with allNodesReady and configVersion. |
| src/lib/utils/message_handler.ts | Adjusts utils.buffer2hex input handling by converting to Uint8Array. |
| src/lib/state.ts | Adds schema 46/47 state fields and schema-gated dump logic (driver/controller/node + metadata). |
| src/lib/node/outgoing_message.ts | Adds result typings for new link reliability check commands. |
| src/lib/node/message_handler.ts | Adds node link reliability commands, gates progress events, and refactors firmware parsing to shared helper. |
| src/lib/node/incoming_message.ts | Adds incoming message types for new node link reliability check commands. |
| src/lib/node/command.ts | Registers new node command strings for link reliability checks. |
| src/lib/forward.ts | Adds schema 47 driver/controller event forwarding and tightens event send guards. |
| src/lib/endpoint/outgoing_message.ts | Adds result typings for new endpoint CC query commands. |
| src/lib/endpoint/message_handler.ts | Implements endpoint get_ccs, may_support_basic_cc, was_cc_removed_via_config. |
| src/lib/endpoint/incoming_message.ts | Adds incoming message types for new endpoint commands. |
| src/lib/endpoint/command.ts | Registers new endpoint command strings. |
| src/lib/driver/outgoing_message.ts | Adds result typings for new driver commands (bootloader, CC version, user agent, RSSI monitoring). |
| src/lib/driver/message_handler.ts | Implements new driver commands and refactors firmware parsing to shared helper. |
| src/lib/driver/incoming_message.ts | Adds incoming message types for new driver commands. |
| src/lib/driver/command.ts | Registers new driver command strings. |
| src/lib/controller/outgoing_message.ts | Adds result typings for many new controller commands (NVM, routing, diagnostics, join/leave, etc.). |
| src/lib/controller/message_handler.ts | Implements new controller commands, shared firmware parsing/options, and join-network callback→event bridging. |
| src/lib/controller/incoming_message.ts | Adds incoming message types for new controller commands and extends firmware update options. |
| src/lib/controller/command.ts | Registers new controller command strings. |
| src/lib/const.ts | Bumps maxSchemaVersion to 47. |
| src/lib/common.ts | Adds shared parseFirmwareFile (incl ZIP fallback) and getFirmwareUpdateOptions. |
| package.json | Bumps package version and updates zwave-js peer/dev dependency versions (+ node types). |
| package-lock.json | Updates lockfile for dependency/version bumps. |
| eslint.config.mjs | Formatting-only ESLint config adjustments. |
| README.md | Documents new commands/events and firmware ZIP fallback behavior. |
| API_SCHEMA.md | Documents schema 45/46/47 changes. |
| .github/workflows/npmpublish.yml | Updates publish workflow permissions, Node version, and npm update step. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b878ea5 to
68952ae
Compare
0dde50c to
4a79aa4
Compare
2 tasks
4a79aa4 to
9f657b0
Compare
d64d12b to
2f8593d
Compare
AlCalzone
previously requested changes
Mar 4, 2026
a6370ae to
8dc47d0
Compare
8dc47d0 to
90374d2
Compare
AlCalzone
requested changes
Mar 5, 2026
Add new controller commands for associations, diagnostics, firmware updates, network join/leave, NVM operations, RF region queries, routing, and watchdog. Add node link reliability commands and endpoint query commands. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These controller methods are not intended for external use. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- buffer2hex: normalize JSON-parsed buffer input (number[] or {type,data})
- getSupportedRFRegions: use readonly in outgoing type, remove unnecessary spread
- getCCs: simplify with Object.fromEntries
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…dlers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… to sendEvent/trySendEvent Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3545c85 to
a9339a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split from #1480 — this PR adds controller, node, and endpoint commands.
Summary
getFirmwareUpdateOptionshelper for consistent firmware update option buildingDetails
New controller commands
controller.restore_nvm_rawfor raw NVM restoration without format conversioncontroller.get_all_associationswith nested map return typecontroller.get_dskreturns DSK as base64 stringcontroller.external_nvm_*buffer commands support base64 encodingcontroller.get_all_available_firmware_updateswith optional parametersbegin_inclusion,replace_failed_node,begin_joining_network,backup_nvm_raw,restore_nvm,restore_nvm_rawShared helpers
getFirmwareUpdateOptionshelper for consistent firmware update option buildingNew node commands
node.check_link_reliability- Extended link reliability check with progress eventsnode.is_link_reliability_check_in_progress- Check if a reliability check is runningnode.abort_link_reliability_check- Abort a running reliability checkNew endpoint commands
endpoint.get_ccs- Get supported command classesendpoint.may_support_basic_cc- Check Basic CC supportendpoint.was_cc_removed_via_config- Check if CC was removed via configNew events
check link reliability progress(node event)joining network show dsk,joining network done(controller events)Test plan
npm test)🤖 Generated with Claude Code