From 82bbf2c78c5f6e99bef2614edae37bb26457d4d3 Mon Sep 17 00:00:00 2001 From: Nathan Spencer Date: Wed, 11 Nov 2026 06:20:35 +0000 Subject: [PATCH] Take vehicle_id first in send_location_to_vehicle Every other method that takes a vehicle id takes it first, and this one hasn't been released yet, so match them now. Also list the lock and unlock exports in the parallax package docstring. Co-Authored-By: Claude Opus 5.5 --- src/rivian/parallax/__init__.py | 8 +++++--- src/rivian/rivian.py | 2 +- tests/test_rivian.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/rivian/parallax/__init__.py b/src/rivian/parallax/__init__.py index 2d97c6d..c5ebbd4 100644 --- a/src/rivian/parallax/__init__.py +++ b/src/rivian/parallax/__init__.py @@ -13,13 +13,15 @@ encode_command(vehicle_id, rvm, payload, ...) -> str Builds and signs a `send_parallax_command` request, with a payload such as `encode_unlock()`. + LOCK_RVM / encode_lock(), UNLOCK_RVM / encode_unlock() + The RVM and payload of a signed lock or unlock command. decode_command_state_message(data) -> dict | None Reads a raw `subscribe_for_parallax_command_state` message. Layout: - core.py - registry, payload parsing and shared helpers - command.py - signed remote commands and their state messages - proto/ - .proto schemas and their generated *_pb2 modules + core.py - registry, payload parsing and shared helpers + command.py - signed remote commands and their state messages + proto/ - .proto schemas and their generated *_pb2 modules .py - one module per RVM topic prefix (body.*, etc.) To add a decoder, decorate it with diff --git a/src/rivian/rivian.py b/src/rivian/rivian.py index 1683581..0d0ebc6 100644 --- a/src/rivian/rivian.py +++ b/src/rivian/rivian.py @@ -645,7 +645,7 @@ async def depart_now( return await self.__graphql_query(headers, url, graphql_json) async def send_location_to_vehicle( - self, location: str, vehicle_id: str + self, vehicle_id: str, location: str ) -> ClientResponse: """Send a destination to a vehicle's navigation. diff --git a/tests/test_rivian.py b/tests/test_rivian.py index b450c8e..634571c 100644 --- a/tests/test_rivian.py +++ b/tests/test_rivian.py @@ -435,7 +435,7 @@ async def test_send_location_to_vehicle(aresponses: ResponsesMockServer) -> None ) response = await rivian.send_location_to_vehicle( - "123 Main St, Springfield, IL", "vehicle_id" + "vehicle_id", "123 Main St, Springfield, IL" ) response_json = await response.json() result = response_json["data"]["parseAndShareLocationToVehicle"]