Repository navigation
feat(vehicle): add missing REST schedule, waypoint and telemetry JWS methods (COR-8) - #28
Merged
Merged
Conversation
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 58 minutes. View limit details
|
…missing-rest-vehicle-methods
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.
Assignee: @Bre77 (bre77)
Summary
Resolves ENG-16 / COR-8: ports the missing REST vehicle methods from
python-tesla-fleet-api'sVehicleFleet. They live on the bound class (VehicleSpecific) only; nothing is added toVehicle.navigation_waypoints_request(waypoints)fleet_telemetry_config_jws(vins, token):POST api/1/vehicles/fleet_telemetry_config_jwsadd_charge_schedule(days_of_week, enabled, lat, lon, start_time?, end_time?, one_time?, id?): derivesstart_enabled/end_enabledand throws if both times are missing, as Python doesadd_precondition_schedule(days_of_week, enabled, lat, lon, precondition_time, id?, one_time?)remove_charge_schedule(id),remove_precondition_schedule(id)batch_remove_charge_schedules(home, work, other),batch_remove_precondition_schedules(home, work, other)days_of_week_maskandDAY_OF_WEEK_BITS: exported fromsrc/commands.ts, where Python keeps them, and re-exported from the package rootAs in Python, the REST schedule methods send
days_of_weekunchanged; only the signed path converts it with the mask. Python'snameparameter is accepted but never sent, so I left it out of the TS signatures.Heads-up: signed vehicles
Commands/VehicleSignedextendVehicleSpecific. Until SGN-8 (ENG-37) adds signed overrides, these schedule and waypoint methods on aVehicleSignedgo to the plaintext REST endpoints. A vehicle that requires signing will reject them.Testing
test/vehiclespecific.test.ts: for each method, checks verb, path and body (after_request's own null stripping), plus theadd_charge_scheduleguard.days_of_week_maskcases cover single names,All,Weekdays, comma lists, whitespace, numeric strings and numbers, and invalid names. Every expected value was checked against Python's owndays_of_week_mask.tsc --noEmit,pnpm lint,pnpm test(374 passed).