Skip to content

feat(vehicle): add remaining signed commands (UI/unit, nav/messaging/media, charging/utility, connectivity/diagnostics)#91

Merged
Bre77 merged 1 commit into
mainfrom
fm/tfa-cmd-ui-units
Jul 22, 2026
Merged

feat(vehicle): add remaining signed commands (UI/unit, nav/messaging/media, charging/utility, connectivity/diagnostics)#91
Bre77 merged 1 commit into
mainfrom
fm/tfa-cmd-ui-units

Conversation

@Bre77

@Bre77 Bre77 commented Jul 22, 2026

Copy link
Copy Markdown
Member

Intent

  • Consolidates four previously-separate command-group PRs (feat(vehicle): add remaining signed commands (UI/unit, nav/messaging/media, charging/utility, connectivity/diagnostics) #91-feat(vehicle): add connectivity/diagnostics signed commands #94) into this single PR - they all touched the same regions of commands.py, so merging them serially just re-created the same conflict each time. Closing feat(vehicle): add navigation/messaging/media signed commands #92/feat(vehicle): add charging/utility signed commands #93/feat(vehicle): add connectivity/diagnostics signed commands #94 in favor of this one.
  • Add 20 new signed commands to Commands (tesla_fleet_api/tesla/vehicle/commands.py), following the existing wrapper pattern (_sendInfotainment), so both the Fleet-signed and BLE transports get them for free:
    • UI/unit preferences: set_temperature_unit, set_distance_unit, set_time_display_format, set_tire_pressure_unit, set_energy_display_format, set_phone_setting_preferences - with matching IntEnums added to const.py (TemperatureUnit, DistanceUnit, TimeDisplayFormat, TirePressureUnit, EnergyDisplayFormat, PhoneFontSize).
    • Navigation/messaging/media: upcoming_calendar_entries/take_drivenote (signed-command siblings of the existing REST-only VehicleFleet methods of the same name), video_request, navigation_route, get_messages.
    • Charging/utility: set_rate_tariff, get_rate_tariff, add_managed_charging_site, remove_managed_charging_site, get_managed_charging_sites, set_discharge_limit (a distinct feature from the existing set_powershare_discharge_limit - confirmed against the proto, separate messages).
    • Connectivity/diagnostics: bluetooth_classic_pairing_request (Bluetooth Classic, not BLE), bandwidth_test, fetch_keys_info.
  • 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).
  • Purely additive - new methods and enum members only, no existing signatures touched.
  • Tests: one file per group (tests/test_ble_ui_unit_preference_commands.py, tests/test_ble_nav_messaging_media_commands.py, tests/test_ble_charging_utility_commands.py, tests/test_ble_connectivity_diagnostics_commands.py) covering each command's built signed message over the mocked BLE transport, plus cross-transport parity tests in tests/test_cross_transport_parity.py for the two REST-sibling commands.

@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: 792d8afe3c

ℹ️ 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 +2492 to +2495
font_size: PhoneFontSize | int = PhoneFontSize.STANDARD,
*,
distance_unit: DistanceUnit | int | None = None,
temperature_unit: TemperatureUnit | int | None = None,

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 Require complete phone preferences for updates

This signature allows callers to update only one phone preference, but the underlying proto fields are implicit proto3 enum fields whose omitted values read back as their zero defaults (STANDARD, MILES, FAHRENHEIT). For example, set_phone_setting_preferences(distance_unit=DistanceUnit.KILOMETERS) also leaves font_size at the default STANDARD and temperature_unit at the default FAHRENHEIT, so a vehicle currently using large phone text or Celsius can be silently reset while changing distance. Please require/pass the full current preference set instead of treating these fields as independently optional.

Useful? React with 👍 / 👎.

@Bre77
Bre77 force-pushed the fm/tfa-cmd-ui-units branch from 792d8af to 4df9447 Compare July 22, 2026 22:19
…media, charging/utility, connectivity/diagnostics)

Consolidates four previously-separate command-group PRs into one to
avoid the same-file merge conflicts serial merging kept re-creating.

Wraps 20 previously-unimplemented VehicleAction fields:
- UI/unit preferences: set_temperature_unit, set_distance_unit,
  set_time_display_format, set_tire_pressure_unit,
  set_energy_display_format, set_phone_setting_preferences.
- Navigation/messaging/media: upcoming_calendar_entries and
  take_drivenote (signed-command siblings of the existing REST-only
  VehicleFleet methods of the same name), video_request,
  navigation_route, get_messages.
- Charging/utility: set_rate_tariff, get_rate_tariff,
  add_managed_charging_site, remove_managed_charging_site,
  get_managed_charging_sites, set_discharge_limit (a distinct feature
  from the existing set_powershare_discharge_limit).
- Connectivity/diagnostics: bluetooth_classic_pairing_request,
  bandwidth_test, fetch_keys_info.

set_rate_tariff takes tesla_protocol message types directly for its
deeply-nested tariff schedule rather than a parallel flattened API.
Both Fleet-signed and BLE transports get every command for free via
the shared Commands ABC. Purely additive - no existing signatures
touched.
@Bre77
Bre77 force-pushed the fm/tfa-cmd-ui-units branch from 4df9447 to 427d3ac Compare July 22, 2026 22:45
@Bre77 Bre77 changed the title feat(vehicle): add UI/unit-preference signed commands feat(vehicle): add remaining signed commands (UI/unit, nav/messaging/media, charging/utility, connectivity/diagnostics) Jul 22, 2026
@Bre77
Bre77 merged commit 08bf3ab into main Jul 22, 2026
5 checks passed

@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: 427d3ac6ce

ℹ️ 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 +2740 to +2742
return await self._sendInfotainment(
Action(
vehicleAction=VehicleAction(getRateTariffRequest=GetRateTariffRequest())

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 new response oneof payloads

When the vehicle answers this new getter, the protobuf response is carried in Response.getRateTariffResponse, but _command() only unwraps ping, vehicleData, and actionStatus before falling through to {"result": True}. In practice get_rate_tariff() will report success while discarding the tariff data; the same applies to the other newly-added response-producing reads such as managed charging sites, messages, and keys info unless their Response oneof fields are explicitly returned.

Useful? React with 👍 / 👎.

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