Skip to content

Add yearly energy data and heat/cool breakdown for BRP084 devices - #119

Open
ryceg wants to merge 3 commits into
fredrike:masterfrom
ryceg:add-yearly-and-heat-cool-energy-data
Open

Add yearly energy data and heat/cool breakdown for BRP084 devices#119
ryceg wants to merge 3 commits into
fredrike:masterfrom
ryceg:add-yearly-and-heat-cool-energy-data

Conversation

@ryceg

@ryceg ryceg commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Query the DSIOT year_power endpoint (this_year / previous_year) in addition to the existing week_power request
  • Read the datas2 (cooling) series from week_power and derive curr_day_cool/curr_day_heat and prev_1day_cool/prev_1day_heat by subtracting cooling energy from the total energy already parsed into datas
  • All new lookups are wrapped in their own try/except DaikinException blocks so devices/firmware that don't expose these fields keep working as before

Test plan

  • Verified against real BRP084 hardware that this_year/previous_year/datas2 populate correctly
  • Confirmed devices without year_power/datas2 support still update status without errors

🤖 Generated with Claude Code

ryceg and others added 2 commits July 4, 2026 09:47
The DSIOT year_power endpoint and week_power datas2 field weren't being
queried, so firmware 2.8.0 devices reported no yearly totals and no
heat/cool split for daily/weekly energy usage.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The heat = total - cool derivation from datas/datas2 is only valid when
the adapter reports combined metering (en_ipw_sep != 1). Read the flag
from adp_i and skip the derivation on separate-metering units to avoid
emitting wrong per-mode figures.

Also extract the energy parsing out of update_status into
_extract_energy / _extract_heat_cool_breakdown / _extract_yearly_energy
helpers so the method stays within pylint's branch/statement limits.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.83%. Comparing base (b29fff7) to head (b197ed2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #119      +/-   ##
==========================================
+ Coverage   84.14%   84.83%   +0.69%     
==========================================
  Files          12       12              
  Lines        1198     1240      +42     
==========================================
+ Hits         1008     1052      +44     
+ Misses        190      188       -2     

☔ View full report in Codecov by Harness.
📢 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.

@fredrike

Copy link
Copy Markdown
Owner

Please update with tests to cover your changes.

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