Skip to content

feat(vehicle): add remaining BLE vehicle-data readers + coverage-lock test#97

Merged
Bre77 merged 2 commits into
mainfrom
fm/tfa-vehdata-readers-lock
Jul 22, 2026
Merged

feat(vehicle): add remaining BLE vehicle-data readers + coverage-lock test#97
Bre77 merged 2 commits into
mainfrom
fm/tfa-vehdata-readers-lock

Conversation

@Bre77

@Bre77 Bre77 commented Jul 22, 2026

Copy link
Copy Markdown
Member

Intent

  • Last PR in the full-coverage pass: wraps the remaining GetVehicleData sub-states with no BLE reader today, and adds a test that locks the whole VehicleAction/GetVehicleData proto surface in place.
  • Add 7 new readers to VehicleBluetooth (tesla_fleet_api/tesla/vehicle/bluetooth.py), following the existing single-sub-state reader pattern: gui_settings, parked_accessory_state, legacy_vehicle_state, alert_state, light_show_state, suspension_state, child_presence_detection_state. Each is wired into vehicle_data()'s endpoints dispatch alongside the existing 12.
  • Naming decision for review: CarServer's GetVehicleState sub-state is exposed as legacy_vehicle_state(), matching the reply field name on VehicleData (legacy_vehicle_state), not vehicle_state() - that name is already taken by the existing VCSEC VehicleStatus reader, a different message from a different domain. This is new public API and can't be renamed later without a breaking change, so flagging it explicitly here.
  • Add a coverage-lock test (tests/test_proto_coverage_lock.py) that walks the VehicleAction/GetVehicleData proto descriptors and asserts every field is wrapped in commands.py/bluetooth.py, or is on one of two small, reasoned allowlists (the push-style subscription/streaming family, and the chunked getVehicleImageState binary transfer - both need their own design, out of scope here). Passes now that every other command PR has landed; a future tesla-protocol bump that adds a new field will fail this test instead of silently drifting the library out of full coverage.
  • Purely additive - no existing signatures touched.
  • Tests in tests/test_ble_mocked_state_readers_new.py cover each new reader decoding a canned VehicleData reply, plus the vehicle_data() dispatch wiring.

firstmate crewmate added 2 commits July 23, 2026 08:48
… test

Wraps the 7 missing GetVehicleData sub-states with no BLE reader today:
gui_settings, parked_accessory_state, legacy_vehicle_state, alert_state,
light_show_state, suspension_state, child_presence_detection_state, and
wires each into vehicle_data()'s endpoints dispatch. CarServer's
GetVehicleState reply field is named legacy_vehicle_state on
VehicleData, so the new reader takes that name rather than
vehicle_state(), which already reads the unrelated VCSEC VehicleStatus.

Adds a coverage-lock test that walks the VehicleAction/GetVehicleData
proto descriptors and asserts every field is wrapped or on a short,
reasoned allowlist (the streaming/subscription family and the chunked
image-transfer sub-state, both needing their own design), so a future
tesla-protocol bump can't silently drift the library out of full
coverage.

getVehicleImageState (chunked binary transfer) and the 7
subscription/streaming VehicleAction fields are out of scope here -
they need their own persistent-broadcast/session design, not a
one-shot wrapper.
Records the coverage-lock test's purpose and allowlists, the
legacy_vehicle_state() naming decision, and why the niche/rate-tariff
commands are shaped the way they are, for future agents touching this
surface.
@Bre77
Bre77 merged commit d2f8cae into main Jul 22, 2026
5 checks passed
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