Skip to content

Add support for predictive mode#623

Merged
DCSBL merged 3 commits into
mainfrom
add-predictive-mode
May 21, 2026
Merged

Add support for predictive mode#623
DCSBL merged 3 commits into
mainfrom
add-predictive-mode

Conversation

@DCSBL
Copy link
Copy Markdown
Collaborator

@DCSBL DCSBL commented May 21, 2026

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.27%. Comparing base (de2397a) to head (5d8d8c9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #623   +/-   ##
=======================================
  Coverage   99.26%   99.27%           
=======================================
  Files           9        9           
  Lines         680      685    +5     
  Branches       63       65    +2     
=======================================
+ Hits          675      680    +5     
  Misses          2        2           
  Partials        3        3           

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for the new Batteries “predictive” mode, exposing it in the Batteries.Mode enum, enabling updates via BatteriesUpdate, and reflecting availability based on API version (>= 2.3.0). Test coverage is extended with new fixtures and snapshot updates to validate parsing and supported-mode detection.

Changes:

  • Add Batteries.Mode.PREDICTIVE and allow creating BatteriesUpdate for it.
  • Extend Device.supported_battery_modes() to include predictive mode for API >= 2.3.0.
  • Update v2 tests/fixtures/snapshots to cover predictive mode behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
homewizard_energy/models.py Adds PREDICTIVE mode to Batteries and exposes it via supported modes + update conversion.
tests/v2/test_v2_device.py Extends supported-battery-modes matrix to include API 2.3.0 predictive mode.
tests/v2/test_v2_batteries.py Adds predictive mode coverage in update mapping + parsing tests.
tests/v2/fixtures/HWE-P1/batteries_2_3_0.json New fixture representing API 2.3.0 batteries payload with predictive mode.
tests/v2/snapshots/test_v2_batteries.ambr Snapshot updated to include predictive-mode deserialization result.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
"mode": "predictive",
"permissions": ["charge_allowed", "discharge_allowed"],
"charge_to_full": false,
@DCSBL DCSBL merged commit 2fca8aa into main May 21, 2026
35 checks passed
@DCSBL DCSBL deleted the add-predictive-mode branch May 21, 2026 14:15
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