Repository navigation
Expose battery dispatch on PowerwallEnergySite - #35
Conversation
|
No actionable comments were generated in the recent review.
|
| 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:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Feature
Possibly related PRs
- Teslemetry/aiopowerwall#28: Adds the client dispatch and resume methods that the EnergySite adapter now calls.
- Teslemetry/aiopowerwall#29: Changes error handling in the client command request path used by these adapter methods.
Merge Risk: 
Minimal · up to 4cdb7
-
The battery dispatch commands are documented, tested, and correctly delegated through the existing client API.
Pre-merge checks: 
5
-
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.
Adds
dispatch_battery_power(power_watts, duration_seconds)andresume_battery_operation()to thePowerwallEnergySiteadapter, delegating to the existingPowerwallClientmethods and returning the cloud command envelope. With this, the tesla-fleet-apiEnergySiteRouter(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.