Fix BRP084 dsiot energy consumption reporting - #142
Open
kengggg wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #142 +/- ##
==========================================
+ Coverage 85.60% 85.61% +0.01%
==========================================
Files 12 12
Lines 1341 1349 +8
==========================================
+ Hits 1148 1155 +7
- Misses 193 194 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kengggg
force-pushed
the
fix-brp084-energy-consumption
branch
from
August 6, 2026 16:03
67995c6 to
ca3495f
Compare
kengggg
force-pushed
the
fix-brp084-energy-consumption
branch
from
August 6, 2026 22:25
ca3495f to
95eac7d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
today_total_energy_consumptionfortoday_energy_consumptionwhen split cool/heat counters are unavailable.week_power.datasdata being present.Details
BRP084 dsiot devices already parse aggregate weekly power data from
week_power.datas;today_total_energy_consumptionuses the last aggregate value as kWh. Some devices/firmware do not expose splitcurr_day_cool/curr_day_heatcounters, so the inheritedtoday_energy_consumptionimplementation returns0by summing two unavailable split values.This keeps the inherited split-counter behavior when either cool or heat data exists, and only falls back to aggregate total energy when both split counters are unavailable.
The BRP084 status path also overrides the base update path, so this PR registers energy consumption history after BRP084 status parsing. That gives the estimated power path history to work from after aggregate energy changes.
Related: #119 is a broader BRP084 energy PR that adds yearly energy and optional cool/heat breakdown support. This PR is intentionally narrower and preserves aggregate-only behavior for devices that expose
datasbut not split counters.Testing
datas=[100,200,300,400,500,600,700]now asserts:today_total_energy_consumption == 0.7today_energy_consumption == 0.70.7datas=[7300,8400,9900,7000,3000,900,900], expecting0.9.uv run pytest tests/test_daikin_brp084.py -q->49 passeduv run pytest tests/test_energy_consumption.py tests/test_power_sensor.py -q->11 passed, 3 skippeduvx ruff check pydaikin/daikin_brp084.py tests/test_daikin_brp084.py-> passeduv run pytest -q->210 passed, 10 skipped