fix: unify iasZone zoneType enum to match ZCL spec#176
Merged
Conversation
- Extract shared ZONE_TYPE_VALUES constant used by both the zoneType attribute and zoneEnrollRequest command - Fix typo: cabonMonoxideSensor -> carbonMonoxideSensor - Fix casing: keyfob -> keyFob (spec says "Key fob") - Unify names: standard -> standardCIE, invalid -> invalidZoneType - Add missing doorWindowHandle (0x0016) zone type from spec
Updated by GitHub Actions after cluster changes. [skip ci]
Contributor
There was a problem hiding this comment.
Pull request overview
Unifies IAS Zone zoneType enum keys across the zoneType attribute and the zoneEnrollRequest command to align with the ZCL spec (Table 8-5), while correcting several enum key inconsistencies and adding a missing zone type.
Changes:
- Extracts shared
ZONE_TYPE_VALUESand reuses it for both thezoneTypeattribute andzoneEnrollRequestcommand iniasZone. - Renames enum keys to match the ZCL spec (
cabonMonoxideSensor→carbonMonoxideSensor,keyfob→keyFob,standard→standardCIE,invalid→invalidZoneType,keyPad→keypad). - Adds missing
doorWindowHandle(0x0016) zone type and updates typings/tests/docs accordingly.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/iasZone.js | Updates assertion to expect renamed zoneType enum key (keyPad → keypad). |
| lib/clusters/iasZone.js | Introduces shared ZONE_TYPE_VALUES and applies it to both attribute and command enum definitions; adds doorWindowHandle. |
| index.d.ts | Updates generated TypeScript unions for zoneType and zoneEnrollRequest to reflect unified enum keys and added value. |
| README.md | Documents breaking changes for the IAS Zone enum unification (but currently misses one rename). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
ZONE_TYPE_VALUESconstant so thezoneTypeattribute andzoneEnrollRequestcommand use the same enum definitioncabonMonoxideSensor->carbonMonoxideSensorkeyfob->keyFob(ZCL spec says "Key fob" - two words)standard->standardCIE,invalid->invalidZoneTypedoorWindowHandle(0x0016) zone type from ZCL spec Table 8-5Breaking changes
New zone type added: doorWindowHandle (0x0016) - was missing from both enums but present in ZCL spec Table 8-5.
Impact analysis
We performed a comprehensive impact analysis across all publicly available Homey Community Store apps. The conclusion is that this fix is safe to apply - no app depends on the mismatched string values at runtime.
Key findings
===, noswitch/case)readAttributesand branch on the string valueApps handling zoneEnrollRequest
5 apps handle the zoneEnrollRequest command and destructure the zoneType field. None depend on the string value:
Apps with vendored copies (informational)
8 apps define their own IAS Zone enum copies via
ZCLDataTypes.enum16()orCluster.addCluster(). Because they override the enum, fixing node-zigbee-clusters will not change their behavior. These apps could update their local copies independently for consistency, but this is purely cosmetic.Test plan
keypad)