feat: extend cluster definitions for BasicZigbeeDevice support#156
Draft
feat: extend cluster definitions for BasicZigbeeDevice support#156
Conversation
Collaborator
RobinBol
commented
Jan 26, 2026
- Add mockDevice.js with createMockDevice() and MOCK_DEVICES presets
- Add clusterSpec.js with ZCL spec definitions for 9 clusters
- Add verifyClusterAttributes() for cluster completeness verification
- Add clusterCompleteness.js test suite (14 new tests)
- Metering (0x0702): 8 → 79 attributes (formatting, TOU, status, historical)
- Door Lock (0x0101): 0 → 43 attributes + 26 commands (PIN/RFID, schedules)
- Window Covering (0x0102): add mode + settings attributes (10 → 20)
- Occupancy Sensing (0x0406): add occupancySensorTypeBitmap + physical contact
Phase 0 - Test Infrastructure: - Add mockDevice.js with createMockDevice() and MOCK_DEVICES presets - Add clusterSpec.js with ZCL spec definitions for 9 clusters - Add verifyClusterAttributes() for cluster completeness verification - Add clusterCompleteness.js test suite (14 new tests) Phase 1 - Cluster Fixes: - Metering (0x0702): 8 → 79 attributes (formatting, TOU, status, historical) - Door Lock (0x0101): 0 → 43 attributes + 26 commands (PIN/RFID, schedules) - Window Covering (0x0102): add mode + settings attributes (10 → 20) - Occupancy Sensing (0x0406): add occupancySensorTypeBitmap + physical contact All clusters now pass ZCL mandatory attribute verification.
There was a problem hiding this comment.
Pull request overview
This PR extends cluster definitions to support comprehensive BasicZigbeeDevice functionality by adding test utilities, cluster specifications, and expanding attribute coverage for critical ZCL clusters.
Changes:
- Adds mock device factory utilities and cluster specification verification framework
- Expands Metering cluster from 8 to 79 attributes covering formatting, TOU, status, and historical data
- Adds complete Door Lock cluster implementation with 43 attributes and 26 commands for PIN/RFID/schedule management
- Enhances Window Covering and Occupancy Sensing clusters with additional mandatory attributes
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/util/mockDevice.js | New utility providing createMockDevice() factory and preset device configurations for testing |
| test/util/index.js | Exports new mock device and cluster verification utilities |
| test/util/clusterSpec.js | New ZCL specification definitions and verification functions for 9 clusters |
| test/iasZone.js | Adds cluster completeness tests and mock device factory usage examples |
| test/clusterCompleteness.js | New comprehensive test suite verifying mandatory attributes across all spec clusters |
| lib/clusters/windowCovering.js | Adds 10 new attributes including mandatory mode and settings attributes |
| lib/clusters/occupancySensing.js | Adds occupancySensorTypeBitmap and physical contact sensor support |
| lib/clusters/metering.js | Expands from 8 to 79 attributes with TOU, formatting, status, and historical consumption |
| lib/clusters/doorLock.js | Complete implementation with 43 attributes and 26 commands for lock management |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…l, and On/Off clusters - Introduced tests for Color Control cluster commands: moveToColor, moveToColorTemperature, and moveToHueAndSaturation. - Added tests for Door Lock cluster commands: lockDoor, unlockDoor, and setPINCode. - Implemented tests for Level Control cluster commands: moveToLevel, step, and stop. - Created tests for On/Off cluster commands: setOn, setOff, toggle, and onWithTimedOff. - Removed outdated cluster completeness tests from IAS Zone and clusterSpec.js.
Add response property to all Door Lock commands per ZCL spec, enabling proper request/response handling. Add unsolicited notification commands (operationEventNotification, programmingEventNotification) with direction property for server-to-client events. Also adds tests for notification command parsing.
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.