Skip to content

feat(vehicle): add charging/utility signed commands#93

Closed
Bre77 wants to merge 1 commit into
mainfrom
fm/tfa-cmd-charging-utility
Closed

feat(vehicle): add charging/utility signed commands#93
Bre77 wants to merge 1 commit into
mainfrom
fm/tfa-cmd-charging-utility

Conversation

@Bre77

@Bre77 Bre77 commented Jul 22, 2026

Copy link
Copy Markdown
Member

Intent

  • Part of a full-coverage pass wrapping every remaining CarServer.VehicleAction proto field - this slice covers charging/utility.
  • Add six new signed commands to Commands: set_rate_tariff, get_rate_tariff, add_managed_charging_site, remove_managed_charging_site, get_managed_charging_sites, set_discharge_limit.
  • set_discharge_limit is a distinct feature from the existing set_powershare_discharge_limit (confirmed against the proto: SetDischargeLimitAction vs. SetPowershareDischargeLimitAction are separate messages) - not a duplicate.
  • set_rate_tariff takes tesla_protocol message types (SetRateTariffRequest.Seasons/.Tariff) directly as arguments rather than a parallel flattened dataclass API, since the tariff schedule is deeply nested (up to 5 named seasons x 4 time-of-use period types) and this is a niche utility-program feature.
  • Purely additive - no existing signatures touched.
  • Tests in tests/test_ble_charging_utility_commands.py cover each command's built signed message over the mocked BLE transport.

Wraps six previously-unimplemented VehicleAction fields: set_rate_tariff,
get_rate_tariff, add_managed_charging_site, remove_managed_charging_site,
get_managed_charging_sites, and set_discharge_limit (a distinct feature
from the existing set_powershare_discharge_limit). set_rate_tariff takes
tesla_protocol message types directly for its deeply-nested tariff
schedule rather than a parallel flattened API.
@Bre77
Bre77 force-pushed the fm/tfa-cmd-charging-utility branch from 58fff73 to c4a65fe Compare July 22, 2026 22:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4a65fe71a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2550 to +2554
return await self._sendInfotainment(
Action(
vehicleAction=VehicleAction(getRateTariffRequest=GetRateTariffRequest())
),
mutating=False,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return the decoded tariff response

When a vehicle replies to this read with the normal infotainment Response.getRateTariffResponse (and similarly getManagedChargingSitesResponse below), Commands._command only unwraps ping, vehicleData, or actionStatus; otherwise it falls through to {"result": True}. As a result these newly added getter APIs can successfully send the request but discard the tariff/site payload, so callers cannot actually read the data the methods advertise; extend the response decoding for these oneof fields before exposing the getters.

Useful? React with 👍 / 👎.

@Bre77

Bre77 commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

Folded into #91 to avoid serial merge conflicts across the same commands.py regions - closing this in favor of the consolidated PR.

@Bre77 Bre77 closed this Jul 22, 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