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

Add remaining 3 phase electrical attributes #339

Draft
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

abmantis
Copy link
Contributor

@abmantis abmantis commented Dec 24, 2024

Follow up to #324

Related HA PR: home-assistant/core#133969

Comment on lines +80 to +99
AttrReportConfig(
attr=ElectricalMeasurement.AttributeDefs.rms_current_ph_b.name,
config=REPORT_CONFIG_OP,
),
AttrReportConfig(
attr=ElectricalMeasurement.AttributeDefs.rms_current_ph_c.name,
config=REPORT_CONFIG_OP,
),
AttrReportConfig(
attr=ElectricalMeasurement.AttributeDefs.rms_current_max.name,
config=REPORT_CONFIG_DEFAULT,
),
AttrReportConfig(
attr=ElectricalMeasurement.AttributeDefs.rms_current_max_ph_b.name,
config=REPORT_CONFIG_DEFAULT,
),
AttrReportConfig(
attr=ElectricalMeasurement.AttributeDefs.rms_current_max_ph_c.name,
config=REPORT_CONFIG_DEFAULT,
),
Copy link
Contributor

@TheJulianJES TheJulianJES Jan 11, 2025

Choose a reason for hiding this comment

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

The not so great thing about this is that we'll add another four attributes to poll per device on each startup.
With #324, that makes it eight attributes that are polled (per device on startup).

That isn't ideal, so we might want to look at only polling the attributes here if they're not marked as unsupported already. Unsupported attributes might change with firmware updates, but otherwise shouldn't (hopefully).

Copy link
Contributor

@TheJulianJES TheJulianJES Jan 11, 2025

Choose a reason for hiding this comment

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

Ah never mind, this PR includes the changes from the other one. So it's only four additional attributes (added in the previous PR).

Copy link
Contributor

@TheJulianJES TheJulianJES Jan 11, 2025

Choose a reason for hiding this comment

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

But we'd also need to set up attribute reporting for power, power factor, and voltage here, right?
That would make a lot of attributes that are read on each startup.

Like mentioned above, we might want to consider only polling the attributes if they're not marked as unsupported already OR allow setting up attribute reports without also polling them on each startup?

@TheJulianJES TheJulianJES added the entities Issue or PR about (custom) entities label Jan 11, 2025
Copy link

codecov bot commented Jan 11, 2025

Codecov Report

Attention: Patch coverage is 92.40506% with 6 lines in your changes missing coverage. Please review.

Project coverage is 96.46%. Comparing base (2d15013) to head (0c64f1b).
Report is 4 commits behind head on dev.

Files with missing lines Patch % Lines
zha/application/platforms/sensor/__init__.py 92.40% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #339      +/-   ##
==========================================
- Coverage   96.50%   96.46%   -0.04%     
==========================================
  Files          61       61              
  Lines        9431     9504      +73     
==========================================
+ Hits         9101     9168      +67     
- Misses        330      336       +6     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
entities Issue or PR about (custom) entities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants