fix(teslemetry): remove dangerous parental_controls_clear_pin methods - #126
Closed
Bre77 wants to merge 1 commit into
Closed
fix(teslemetry): remove dangerous parental_controls_clear_pin methods#126Bre77 wants to merge 1 commit into
Bre77 wants to merge 1 commit into
Conversation
Both custom_command routes stay hidden in the served API spec (dangerous class: they erase a stored parental-control safety PIN, same class as remove_key) per Teslemetry/api#425. Library and public spec must agree.
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.
Intent
Remove parental_controls_clear_pin and parental_controls_clear_pin_admin from the Teslemetry class (tesla_fleet_api/teslemetry/vehicle.py), added in the 1.10.0 parity uplift (PR #124), plus their tests in tests/test_teslemetry_vehicle_custom_commands.py. These two custom_command routes stay hidden/dangerous per the captain-confirmed classification in api PR https://github.com/Teslemetry/api/pull/425 (merged 2026-08-15): they erase a stored parental-control safety PIN, the same credential-erasure class as the already-public remove_key, and the served OpenAPI spec keeps them hidden. Library and public spec must agree: hidden routes get no published client methods. Verified against PR 425's full 42-route verdict table that these are the ONLY library-published-but-spec-hidden methods in the 'dangerous' class - the other 6 routes PR 425 kept hidden (set_discharge_limit, set_outlet_timer, set_power_feed_timer, batch_remove_charge_schedules, batch_remove_precondition_schedules, drivenote) have no published tesla-fleet-api 1.10.0 method at all, so nothing to remove for those. Note: tesla_fleet_api/tesla/vehicle/commands.py (the BLE/signed-command protocol implementation, a separate class predating 1.10.0 since March 2026) also defines methods with these same names - out of scope, not touched, since the task and PR 425 concern the Teslemetry REST custom_command routes specifically, not the BLE vehicle-command protocol. Nothing else changes in this PR - no version bump (bump-only PRs are shipped separately per standing repo rule). PR body must state a one-line rationale per removal pointing at the served-spec policy from PR 425.
What Changed
TeslemetryVehicle.parental_controls_clear_pinandparental_controls_clear_pin_adminfromtesla_fleet_api/teslemetry/vehicle.py. Both routes erase a stored parental-control safety PIN (the same credential-erasure class as the already-publicremove_key) and were confirmed hidden in Teslemetry's served OpenAPI spec per api PR #425 — the library must not publish client methods for routes the spec keeps hidden.test_parental_controls_clear_pin,test_parental_controls_clear_pin_admin) fromtests/test_teslemetry_vehicle_custom_commands.py.tesla_fleet_api/tesla/vehicle/commands.py, which predates this REST addition and defines methods of the same name, is intentionally untouched — it's a separate protocol surface outside PR #425's scope.Risk Assessment
✅ Low: The change is a minimal, precisely-scoped deletion (two methods and their tests) that exactly matches the stated intent, leaves the unrelated BLE commands.py implementation untouched as required, includes no version bump, and leaves no dangling references to the removed methods anywhere in the codebase.
Testing
Ran the targeted test module for Teslemetry custom-command routes (all 36 pass) and manually confirmed via attribute introspection that TeslemetryVehicle no longer exposes parental_controls_clear_pin/_admin while sibling parental-controls methods remain intact; grep confirmed no other file references the removed methods except the correctly out-of-scope BLE commands.py, and no version bump was included in the diff.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
uv run pytest tests/test_teslemetry_vehicle_custom_commands.py -v— all 36 tests pass, confirming remaining parental-controls/custom-command routes still build correct requests after the removalgrep -rn "parental_controls_clear_pin" --include="*.py" --include="*.md" .— confirmed the only remaining references are in tesla_fleet_api/tesla/vehicle/commands.py (the separate, intentionally out-of-scope BLE/signed-command implementation)Manual attribute check:hasattr(TeslemetryVehicle, 'parental_controls_clear_pin')/_adminboth False post-change, while a sibling method (parental_controls_enable_setting) remains True — confirms the public client surface no longer exposes the two hidden/dangerous routesgit diff 719ef8b..bc73c17 -- pyproject.toml tesla_fleet_api/__init__.py— empty, confirming no version bump was bundled, per the stated standing repo rule✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.