Repository navigation
Mark local-path errors failover_safe for tesla_fleet_api's Router - #37
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Error markers and classification tests src/aiopowerwall/exceptions.py, tests/test_exceptions.py |
Connection, authentication, and rate-limit errors define failover_safe = True. Tests check these markers and confirm command and unsupported-operation errors are not marked true. |
Priority:
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Bug fix
Possibly related PRs
- Teslemetry/aiopowerwall#29: Adds command and unsupported-operation errors that this change tests as unmarked.
- Teslemetry/aiopowerwall#35: Adds local EnergySite commands and describes router failover between local and cloud.
Merge Risk: 
Minimal · up to d6f9d
-
The change is consistent with the intended failover behavior and includes focused marker tests.
Pre-merge checks: 
5
-
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.
-
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.
Teslemetry/python-tesla-fleet-api#200 makes the Router fail over only on errors marked failover-safe. Without a marker, an EnergySiteRouter whose local gateway is unreachable would stop failing over to the cloud.
failover_safe = True(the mechanism PR 200 defines) onPowerwallConnectionError,PowerwallRateLimitErrorandPowerwallAuthenticationError.PowerwallCommandError(andPowerwallNotSupportedError) unmarked: the gateway answered and rejected the command, so the cloud would reach the same device.tests/test_exceptions.py. The tesla-protocol pin stays>=4.0.0,<5.