From 4a5f38b048b44d96d90f9a82e1293f0c299c1cc4 Mon Sep 17 00:00:00 2001 From: Walt Howd Date: Wed, 11 Nov 2026 02:29:15 +0000 Subject: [PATCH] Wake the vehicle when sending it a location `send_location_to_vehicle` now asks Rivian to wake the vehicle, as the Rivian app's "Send to vehicle" does, so a sleeping vehicle still gets the destination. Its docstring also notes that a map link works as the location. Verified against a 2026 R1S (Gen 2) running 2026.36.01 with the wake-up flag: a Google Maps link and a Rivian place link each started navigating there. Not tested: sending to a sleeping vehicle without the flag. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FxWHBTrHU6eTPotwMWgtJF --- src/rivian/rivian.py | 15 ++++++++++----- tests/test_rivian.py | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/rivian/rivian.py b/src/rivian/rivian.py index 0d0ebc6..8bb5a45 100644 --- a/src/rivian/rivian.py +++ b/src/rivian/rivian.py @@ -647,10 +647,11 @@ async def depart_now( async def send_location_to_vehicle( self, vehicle_id: str, location: str ) -> ClientResponse: - """Send a destination to a vehicle's navigation. + """Send a destination to a vehicle's navigation, waking it if needed. - `location` is an address, a place, or coordinates as "lat,lng", and Rivian - parses it. A `publishResponse.result` of 0 means the request was accepted. + `location` is an address, a place, coordinates as "lat,lng", or a map link, + and Rivian parses it. A `publishResponse.result` of 0 means the request was + accepted. """ url = GRAPHQL_GATEWAY headers = BASE_HEADERS | { @@ -660,8 +661,12 @@ async def send_location_to_vehicle( } graphql_json = { "operationName": "parseAndShareLocationToVehicle", - "query": "mutation parseAndShareLocationToVehicle($str: String!, $vehicleId: String!) { parseAndShareLocationToVehicle(str: $str, vehicleId: $vehicleId) { __typename publishResponse { __typename result } } }", - "variables": {"str": location, "vehicleId": vehicle_id}, + "query": "mutation parseAndShareLocationToVehicle($str: String!, $vehicleId: String!, $requiresWakeup: Boolean) { parseAndShareLocationToVehicle(str: $str, vehicleId: $vehicleId, requiresWakeup: $requiresWakeup) { __typename publishResponse { __typename result } } }", + "variables": { + "str": location, + "vehicleId": vehicle_id, + "requiresWakeup": True, + }, } return await self.__graphql_query(headers, url, graphql_json) diff --git a/tests/test_rivian.py b/tests/test_rivian.py index 634571c..bb3f3ef 100644 --- a/tests/test_rivian.py +++ b/tests/test_rivian.py @@ -443,6 +443,7 @@ async def test_send_location_to_vehicle(aresponses: ResponsesMockServer) -> None assert requests[0]["variables"] == { "str": "123 Main St, Springfield, IL", "vehicleId": "vehicle_id", + "requiresWakeup": True, } await rivian.close()