Skip to content

Add Teslemetry open_rear_trunk and close_rear_trunk - #195

Merged
Bre77 merged 1 commit into
mainfrom
fm/tfa-teslemetry-trunk-directional
Oct 28, 2026
Merged

Bre77 merged 1 commit into
mainfrom
fm/tfa-teslemetry-trunk-directional

Conversation

@Bre77

@Bre77 Bre77 commented Oct 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Add TeslemetryVehicle.open_rear_trunk() and close_rear_trunk(). They call closure(rear_trunk=ClosureState.OPEN/CLOSE) (custom_command/closure, body {"rearTrunk": "open"|"close"}).
  • The names and the dict[str, Any] return match VehicleBluetooth.open_rear_trunk()/close_rear_trunk() (Add Bluetooth open_rear_trunk and close_rear_trunk #191). VehicleRouter routes any method that both backends have, so a Bluetooth-paired car out of range now fails over to the cloud. No router change was needed.
  • Same pattern as the existing open_tonneau/close_tonneau.

Tests

  • tests/test_teslemetry_vehicle_custom_commands.py: request shape for both methods, and a router test (Bluetooth success skips the cloud; Bluetooth failure fails over to the cloud with the rearTrunk: close request). 45 passed. ruff check and pyright clean.

No release in this PR.

Map them to closure(rear_trunk=OPEN/CLOSE) with the same names as
VehicleBluetooth, so VehicleRouter fails over from Bluetooth to the cloud.
@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 a49d231 and 0d65140.

Files selected for processing: 2
  • tesla_fleet_api/teslemetry/vehicle.py
  • tests/test_teslemetry_vehicle_custom_commands.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

TeslemetryVehicle adds methods to open and close the rear trunk. Tests check the closure request values and verify BLE success and cloud fallback when closing.

Changes: Rear trunk commands

Layer / File(s) Summary
Rear-trunk closure commands
tesla_fleet_api/teslemetry/vehicle.py, tests/test_teslemetry_vehicle_custom_commands.py
The new methods delegate to closure() with the open or close state. Tests check the request values and verify that closing uses BLE when successful and falls back to a cloud request on ConnectionError.

Priority: Normal

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

Change: Feature

Merge Risk: Minimal · up to 0d651

No merge-blocking risk is identified for the rear-trunk commands.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the two methods added by the pull request and matches the main change.
Description check Passed The description accurately explains the new methods, request payloads, routing behavior, tests, and validation results.
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: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 1 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 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 3691008 into main Oct 28, 2026
7 checks passed
@Bre77
Bre77 deleted the fm/tfa-teslemetry-trunk-directional branch October 28, 2026 06:54
@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