-
Notifications
You must be signed in to change notification settings - Fork 13
feat: extend cluster definitions for BasicZigbeeDevice support #156
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
base: master
Are you sure you want to change the base?
Conversation
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.
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 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.