Skip to content

feat: add schema 47 controller, node, and endpoint commands (3/4)#1513

Merged
raman325 merged 6 commits into
masterfrom
feat/schema-47-controller-node-endpoint
Mar 10, 2026
Merged

feat: add schema 47 controller, node, and endpoint commands (3/4)#1513
raman325 merged 6 commits into
masterfrom
feat/schema-47-controller-node-endpoint

Conversation

@raman325
Copy link
Copy Markdown
Collaborator

@raman325 raman325 commented Feb 27, 2026

Blocked by: #1510

Split from #1480 — this PR adds controller, node, and endpoint commands.

Summary

  • Add new controller commands for associations, diagnostics, firmware updates, network join/leave, NVM operations, RF region queries, and routing
  • Add getFirmwareUpdateOptions helper for consistent firmware update option building
  • Add node link reliability check commands
  • Add endpoint query commands

Details

New controller commands

  • All standard controller commands from Z-Wave JS API are now supported
  • controller.restore_nvm_raw for raw NVM restoration without format conversion
  • controller.get_all_associations with nested map return type
  • controller.get_dsk returns DSK as base64 string
  • controller.external_nvm_* buffer commands support base64 encoding
  • controller.get_all_available_firmware_updates with optional parameters
  • Callback-to-event conversion documentation for begin_inclusion, replace_failed_node, begin_joining_network, backup_nvm_raw, restore_nvm, restore_nvm_raw

Shared helpers

  • getFirmwareUpdateOptions helper for consistent firmware update option building

New node commands

  • node.check_link_reliability - Extended link reliability check with progress events
  • node.is_link_reliability_check_in_progress - Check if a reliability check is running
  • node.abort_link_reliability_check - Abort a running reliability check

New endpoint commands

  • endpoint.get_ccs - Get supported command classes
  • endpoint.may_support_basic_cc - Check Basic CC support
  • endpoint.was_cc_removed_via_config - Check if CC was removed via config

New events

  • check link reliability progress (node event)
  • joining network show dsk, joining network done (controller events)

Test plan

  • All existing tests pass (npm test)
  • Verify new controller/node/endpoint commands work end-to-end

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 27, 2026 06:49
@raman325 raman325 force-pushed the feat/schema-47-controller-node-endpoint branch 2 times, most recently from 4da184d to 0dde50c Compare February 27, 2026 07:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread src/lib/utils/message_handler.ts Outdated
@raman325 raman325 changed the base branch from master to feat/schema-47-driver-commands February 27, 2026 07:25
@raman325 raman325 closed this Feb 27, 2026
@raman325 raman325 reopened this Feb 27, 2026
@raman325 raman325 force-pushed the feat/schema-47-driver-commands branch from b878ea5 to 68952ae Compare February 27, 2026 07:36
@raman325 raman325 force-pushed the feat/schema-47-controller-node-endpoint branch from 0dde50c to 4a79aa4 Compare February 27, 2026 07:36
@raman325 raman325 changed the base branch from feat/schema-47-driver-commands to master February 27, 2026 07:37
@raman325 raman325 marked this pull request as draft February 27, 2026 07:39
@raman325 raman325 force-pushed the feat/schema-47-controller-node-endpoint branch from 4a79aa4 to 9f657b0 Compare February 27, 2026 07:48
@raman325 raman325 added the enhancement New feature or request label Feb 27, 2026
@raman325 raman325 force-pushed the feat/schema-47-controller-node-endpoint branch 8 times, most recently from d64d12b to 2f8593d Compare March 3, 2026 20:02
@raman325 raman325 marked this pull request as ready for review March 3, 2026 20:02
Comment thread src/lib/controller/message_handler.ts Outdated
Comment thread src/lib/controller/message_handler.ts Outdated
Comment thread src/lib/endpoint/message_handler.ts Outdated
@raman325 raman325 requested a review from AlCalzone March 4, 2026 17:04
@raman325 raman325 force-pushed the feat/schema-47-controller-node-endpoint branch from a6370ae to 8dc47d0 Compare March 4, 2026 21:56
Comment thread src/lib/controller/message_handler.ts Outdated
raman325 and others added 6 commits March 10, 2026 00:40
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>
@raman325 raman325 force-pushed the feat/schema-47-controller-node-endpoint branch from 3545c85 to a9339a0 Compare March 10, 2026 04:44
@raman325 raman325 merged commit f6bc3fe into master Mar 10, 2026
1 check passed
@raman325 raman325 deleted the feat/schema-47-controller-node-endpoint branch March 10, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants