Skip to content
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

Separate polling attributes in electrical measurement cluster #354

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

abmantis
Copy link
Contributor

As suggested in #339 (comment) this adds
an ZCL_POLLING_ATTRS to define attributes that should be polled
separatelly from the ones that can have reporting config.

This also moves some attributes that do no support reporting config out
of REPORT_CONFIG.

As suggested in zigpy#339 (comment) this adds
an `ZCL_POLLING_ATTRS` to define attributes that should be polled
separatelly from the ones that can have reporting config.

This also moves some attributes that do no support reporting config out
of `REPORT_CONFIG`.
Copy link

codecov bot commented Jan 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.50%. Comparing base (a833f43) to head (af6bdc7).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #354      +/-   ##
==========================================
- Coverage   96.51%   96.50%   -0.01%     
==========================================
  Files          61       61              
  Lines        9457     9455       -2     
==========================================
- Hits         9127     9125       -2     
  Misses        330      330              

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

Copy link
Contributor

@TheJulianJES TheJulianJES left a comment

Choose a reason for hiding this comment

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

Let's change ZCL_POLLING_ATTRS to just be a list of the attribute names, similar to ZCL_INIT_ATTRS. (async_update needs to be adjusted too then.)

@abmantis
Copy link
Contributor Author

Let's change ZCL_POLLING_ATTRS to just be a list of the attribute names, similar to ZCL_INIT_ATTRS. (async_update needs to be adjusted too then.)

Yeah, that was a stupid Sunday night copy/paste I did there 🙃

@TheJulianJES TheJulianJES changed the title Separate polling attributes in homeautomation cluster Separate polling attributes in electrical measurement cluster Jan 21, 2025
)
ZCL_POLLING_ATTRS = {
Copy link
Contributor

@TheJulianJES TheJulianJES Jan 21, 2025

Choose a reason for hiding this comment

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

Actually, we might want ZCL_POLLING_ATTRS to be a list instead of a set, so that the attributes are always polled in the same (expected) order. So, just ZCL_POLLING_ATTRS = [...].

Since we don't poll the divider/multiplier here at the moment, this might not matter, but I think it would be better anyways and keep the same order from before when a (sorted) dict was used.

(Since we're not searching for anything in ZCL_POLLING_ATTRS, a list should be fine performance-wise. Might even save a bit on memory if we use a list. Though it's not like that really matters here..)

@abmantis abmantis requested a review from TheJulianJES January 21, 2025 12:25
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