Skip to content

Cluster data type cleanup#1759

Draft
puddly wants to merge 9 commits into
zigpy:devfrom
puddly:puddly/spec-verification
Draft

Cluster data type cleanup#1759
puddly wants to merge 9 commits into
zigpy:devfrom
puddly:puddly/spec-verification

Conversation

@puddly

@puddly puddly commented Feb 4, 2026

Copy link
Copy Markdown
Collaborator

I've made a second pass through our cluster definitions and implemented every enum and bitmap properly. This migrates zigpy itself away from using t.enum8 or t.bitmap8 internally, in preparation for slowly deprecating the generic types.

@codecov

codecov Bot commented Feb 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.53%. Comparing base (b2ee3c3) to head (786d478).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1759      +/-   ##
==========================================
+ Coverage   99.51%   99.53%   +0.01%     
==========================================
  Files          63       63              
  Lines       12676    13205     +529     
==========================================
+ Hits        12615    13144     +529     
  Misses         61       61              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread zigpy/zcl/clusters/closures.py
Comment thread zigpy/zcl/clusters/general.py
Comment thread zigpy/zcl/clusters/general.py
Comment thread zigpy/zcl/clusters/general.py
Comment thread zigpy/zcl/clusters/hvac.py
Comment thread zigpy/zcl/clusters/closures.py
Comment thread zigpy/zcl/clusters/smartenergy.py
Comment on lines 571 to 575
class AttributeDefs(BaseAttributeDefs):
fan_mode: Final = ZCLAttributeDef(id=0x0000, type=FanMode, access="")
fan_mode_sequence: Final = ZCLAttributeDef(
id=0x0001, type=FanModeSequence, access=""
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Access and mandatory can be added to the Fan attributes:

    class AttributeDefs(BaseAttributeDefs):
        fan_mode: Final = ZCLAttributeDef(
            id=0x0000, type=FanMode, access="rw", mandatory=True
        )
        fan_mode_sequence: Final = ZCLAttributeDef(
            id=0x0001, type=FanModeSequence, access="rw", mandatory=True
        )

id=0x000F, type=Options, access="rw", mandatory=True
)
# Defined Primaries Information
num_primaries: Final = ZCLAttributeDef(id=0x0010, type=t.uint8_t, access="r")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

num_primaries is apparently mandatory=True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants