Add set_temps and actuate_trunk commands - #162
Draft
ivan-ruban wants to merge 1 commit into
Draft
ivan-ruban wants to merge 1 commit into
ivan-ruban wants to merge 1 commit into
Conversation
Both follow the Fleet API request format, so clients that already speak
Fleet API (e.g. home automation that switches between a cloud proxy and
this BLE proxy) need no changes:
- set_temps: {"driver_temp": 21, "passenger_temp": 21}, Celsius 15-28,
numbers or strings; passenger_temp defaults to driver_temp.
Uses vehicle.ChangeClimateTemp.
- actuate_trunk: {"which_trunk": "rear"|"front"}. rear toggles the trunk
(vehicle.ActuateTrunk), front opens the frunk (vehicle.OpenFrunk).
Invalid bodies are rejected before anything is sent to the car and are
not retried. Both commands need a key with the owner role.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two Fleet API commands that
vehicle-commandalready supports over BLE but the proxy did not expose:set_temps{"driver_temp": 21, "passenger_temp": 21}(Celsius 15–28, number or string;passenger_tempoptional, defaults todriver_temp)ChangeClimateTempactuate_trunk{"which_trunk": "rear"}or"front"rear→ActuateTrunk(toggles),front→OpenFrunkThe bodies match the Fleet API, so a client that already speaks Fleet API can switch to this proxy without changes. My use case: home automation that starts preconditioning at a set temperature and opens the trunk while the car is parked at home.
Invalid bodies are rejected before anything is sent to the car, with
shouldRetry = false. Both commands need a key with the owner role, likedoor_unlock. README is updated.Tests
commands_parse_test.go: table tests for both body parsers, plus a check that invalid bodies are not retried. Passing.go vet ./internal/tesla/...is clean, andgo build .succeeds.Note, unrelated to this PR:
TestAllExceptedCommandsImplementedalready panics ondevwithout this change. It callsSendwith a zero-valuevehicle.Vehicle, andClimateOndereferences nil insidegetReceiver. CI doesn't rungo test, so it hasn't shown up. I left it alone to keep this PR focused, and can send a separate fix if you like.🤖 Generated with Claude Code