feat(commissioning): persist SpecificationVersion, SoftwareVersion, and SerialNumber#66
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds persistence and display of additional Basic Information attributes captured during commissioning, enabling richer node metadata in the store and tree outputs.
Changes:
- Extend commissioning flow to read and carry through
SpecificationVersion,SoftwareVersion, andSerialNumber. - Persist the new fields on
store.Node(withomitempty) and propagate them into tree rendering data. - Add
basicinformation.FormatSpecVersionhelper and tests; enrichtree(rich + D2) output with spec/FW/SN when present.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/store/types.go | Add persisted node fields for spec version, software version, and serial number. |
| internal/commissioning/flow.go | Read three additional Basic Information attributes into CommissioningResult. |
| internal/commissioning/flow_test.go | Add tests covering presence/absence behavior for the new attributes. |
| internal/clusters/basicinformation/specversion.go | Add helper to format packed SpecificationVersion into a human-readable string. |
| internal/clusters/basicinformation/specversion_test.go | Add table-driven tests for FormatSpecVersion. |
| cli/commission.go | Copy new commissioning result fields into store.Node. |
| cli/tree.go | Populate tree rendering data with the new node fields. |
| cli/output/tree.go | Display Matter spec version, FW version, and serial number in rich tree output (when present). |
| cli/output/tree_d2.go | Display Matter spec version, FW version, and serial number in D2/SVG output (when present). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nd SerialNumber (#50) Read the three new Basic Information attributes during commissioning and persist them to the node store. The tree output now shows Matter spec version, firmware version, and serial number alongside the existing vendor/product lines, omitting fields that are absent or zero so pre-1.3 and serial-less devices are unaffected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…racy - Correct FormatSpecVersion doc comment: minor is always included, only trailing zero patch is omitted. - Replace global readErr in TestReadDeviceInfo_MissingAttributes with per-attribute readOverrides for the three optional attributes, so the test accurately simulates a device that exposes mandatory attributes but not SoftwareVersion/SerialNumber/SpecificationVersion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
98238f0 to
3c68d87
Compare
Rename labels for clarity (Product → Product ID, Matter → Spec Version, Serial → Serial Number) and pad all labels to a fixed width so values line up in a single column. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Closes #50
Summary
CommissioningResult— addedSpecificationVersion uint32,SoftwareVersion uint32,SerialNumber stringreadDeviceInfo— reads attributes0x0009(SoftwareVersion),0x000F(SerialNumber),0x0015(SpecificationVersion) from the Basic Information cluster; errors stay non-fatal so pre-1.3 and serial-less devices commission without issuestore.Node— three new fields withomitemptyJSON tags; old Bolt records decode without errorbuildNodeFromResult— copies all three fields through (coverscommission code,commission ip, andcommission ble)basicinformation.FormatSpecVersion— new helper in a non-generated file that decodes0x01030000→"1.3", dropping trailing zero componentsmatter @N tree—FormatRichTreeandbuildD2Scriptnow show Matter spec version, firmware version, and serial number; any field that is zero/empty is omittedTest plan
TestReadDeviceInfo_NewAttributes— verifies all three attributes are read and surfaced in the resultTestReadDeviceInfo_MissingAttributes— verifies commissioning succeeds and fields stay zero/empty when the device doesn't expose themTestFormatSpecVersion— 6 table-driven cases covering zero, 1.3, 1.4, 1.0, and multi-component versionsmise run testpasses (all 12 test packages)mise run lintpasses🤖 Generated with Claude Code