Skip to content

Fix EventableCluster not listening to AttributeUpdatedEvent#4763

Draft
TheJulianJES wants to merge 1 commit intozigpy:devfrom
TheJulianJES:tjj/fix_eventable_cluster_events
Draft

Fix EventableCluster not listening to AttributeUpdatedEvent#4763
TheJulianJES wants to merge 1 commit intozigpy:devfrom
TheJulianJES:tjj/fix_eventable_cluster_events

Conversation

@TheJulianJES
Copy link
Collaborator

@TheJulianJES TheJulianJES commented Feb 16, 2026

Proposed change

This fixes an issue where the EventableCluster does not listen to AttributeUpdatedEvent events.

For example, if a Tuya datapoint is remapped to a "ZCL" attribute, which is updated using update_attribute, it'll never fire AttributeReportedEvent, only AttributeUpdatedEvent. So, the zha_event for the attribute update is never fired.

Additional information

Should hopefully address:

See related quirk:

class TuyaCustomCluster(TuyaNewManufCluster, EventableCluster):
"""Tuya Custom Cluster for mapping data points to attributes."""
dp_to_attribute: dict[int, DPToAttributeMapping] = {
1: DPToAttributeMapping(
TuyaNewManufCluster.ep_attribute,
ATTR_BTN_1_PRESSED,
),
2: DPToAttributeMapping(
TuyaNewManufCluster.ep_attribute,
ATTR_BTN_2_PRESSED,
),
}
data_point_handlers = {
1: "_dp_2_attr_update",
2: "_dp_2_attr_update",
}

It would probably make sense to add decent test coverage for EventableCluster in another PR.
Maybe even utilizing the Tuya datapoint remapping, or just have update_attribute be called there.

Device diagnostics

Possibly in linked HA issue or already in ZHA diagnostics.

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works
  • Device diagnostics data has been attached

@TheJulianJES TheJulianJES force-pushed the tjj/fix_eventable_cluster_events branch from 35c965b to 34713c4 Compare February 16, 2026 18:56
@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.32%. Comparing base (40b41de) to head (34713c4).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #4763   +/-   ##
=======================================
  Coverage   92.32%   92.32%           
=======================================
  Files         371      371           
  Lines       12190    12191    +1     
=======================================
+ Hits        11254    11255    +1     
  Misses        936      936           

☔ 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.

@TheJulianJES TheJulianJES added the bugfix This PR fixes a bug label Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments