Skip to content

Expose battery dispatch on PowerwallEnergySite - #35

Merged
Bre77 merged 1 commit into
mainfrom
fm/apw-energysite-dispatch
Oct 28, 2026
Merged

Bre77 merged 1 commit into
mainfrom
fm/apw-energysite-dispatch

Conversation

@Bre77

@Bre77 Bre77 commented Oct 28, 2026

Copy link
Copy Markdown
Member

Adds dispatch_battery_power(power_watts, duration_seconds) and resume_battery_operation() to the PowerwallEnergySite adapter, delegating to the existing PowerwallClient methods and returning the cloud command envelope. With this, the tesla-fleet-api EnergySiteRouter (Teslemetry/python-tesla-fleet-api#193) can route both commands to the local primary before cloud failover.

Tests: tests/test_energysite.py (49 passed), ruff, mypy. No hardware command was run.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 0097f2c and 4cdb71c.

Files selected for processing: 3
  • README.md
  • src/aiopowerwall/energysite.py
  • tests/test_energysite.py

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Walkthrough

The EnergySite adapter now exposes timed battery dispatch and battery-operation resume methods. Both delegate to the local client and return the standard successful command envelope. Tests cover delegation and responses, and the README lists both methods.

Changes: Battery dispatch commands

Layer / File(s) Summary
Expose and verify battery commands
src/aiopowerwall/energysite.py, tests/test_energysite.py, README.md
The adapter delegates dispatch wattage and duration, and resume requests, to the local client. Tests check the calls and success envelopes. The README lists both methods.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related PRs

Merge Risk: Minimal · up to 4cdb7

The battery dispatch commands are documented, tested, and correctly delegated through the existing client API.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the main change: PowerwallEnergySite now exposes battery dispatch. The raw summary confirms dispatch_battery_power and resume_battery_operation are added to that adapter and delegate t…
Description check Passed The description states that dispatch_battery_power(power_watts, duration_seconds) and resume_battery_operation() are added to the PowerwallEnergySite adapter. It says they delegate to existing Powerwa…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: PowerwallEnergySite now exposes battery dispatch. The raw summary confirms dispatch_battery_power and resume_battery_operation are added to that adapter and delegate to PowerwallClient. The title covers the primary change but not resume_battery_operation, which is acceptable because titles need not cover every detail.

Full details: Description check

Explanation

The description states that dispatch_battery_power(power_watts, duration_seconds) and resume_battery_operation() are added to the PowerwallEnergySite adapter. It says they delegate to existing PowerwallClient methods, return the cloud command envelope, and were tested in tests/test_energysite.py. This matches the changeset summary.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files. (1 skipped: 1 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@Bre77
Bre77 merged commit 86adcc9 into main Oct 28, 2026
6 checks passed
@Bre77 Bre77 mentioned this pull request Oct 28, 2026
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.

1 participant