Repository navigation
Conversation
Send a destination (an address, a place, or "lat,lng") to a vehicle's navigation with the parseAndShareLocationToVehicle mutation, which Rivian parses server side. Lets the integration offer a send-destination entity.
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.
Summary
Adds
Rivian.send_location_to_vehicle(location, vehicle_id), which sends a destination to a vehicle's navigation with theparseAndShareLocationToVehiclemutation.locationis an address, a place, or"lat,lng", and Rivian parses it server side. The integration needs this for a "Send destination" notify entity.Changes
src/rivian/rivian.py:send_location_to_vehicle, placed after the departure schedule methods and built the same way (inlineBASE_HEADERS | {Csrf-Token, A-Sess, U-Sess}, a one-line query,__graphql_query). It returns theClientResponse. ApublishResponse.resultof 0 means Rivian accepted the request.tests/responses.py:SEND_LOCATION_TO_VEHICLE_RESPONSE.tests/test_rivian.py:test_send_location_to_vehiclechecks the request variables (str,vehicleId) and the result.Testing
233 passed (232 at 67ba96f, plus 1 new). Ruff and mypy are clean.
Notes
__typenameto match this client's other mutations. Our fork's test fixture gives the response types asParseAndShareLocationToVehicleResponseandPublishResponse. The mutation is not in our captured gateway schema, so the selection was not checked against a schema.