Skip to content

Request the tonneau option with user information - #233

Draft
jrgutier wants to merge 1 commit into
bretterer:mainfrom
jrgutier:up/tonneau-option
Draft

jrgutier wants to merge 1 commit into
bretterer:mainfrom
jrgutier:up/tonneau-option

Conversation

@jrgutier

Copy link
Copy Markdown
Collaborator

Summary

getUserInfo now also asks for each vehicle's mobileConfiguration.tonneauOption. Its optionId
(TON-P01 for the powered tonneau) is how the Rivian app decides whether a vehicle has a powered
tonneau cover. supportedFeatures has no flag for it.

Changes

  • get_user_information: add
    mobileConfiguration { __typename tonneauOption { __typename optionId optionName } } inside
    vehicle { … }.
  • schemas/gateway.graphql: add tonneauOption: VehicleMobileConfigurationOption to
    VehicleMobileConfiguration. It is nullable, unlike its four siblings, because a vehicle without
    a tonneau option may return null.
  • tests/responses.py: USER_INFORMATION_RESPONSE gets a tonneauOption with optionId
    TON-P01.
  • test_get_user_information: captures the request and asserts the query asks for
    tonneauOption { __typename optionId optionName }.

Testing

PYTHONPATH=src pytest -q -p no:cacheprovider   # 232 passed (232 before; one existing test extended)
ruff check . && ruff format --check .           # clean
mypy src/rivian                                 # no issues in 51 source files

The extended test fails without the rivian.py change.

Notes

  • The field and the check come from the Rivian Android app. Its user-vehicle model tests
    tonneauOptionId.contains(TONNEAU_POWER_OPTION_ID), with TON-P01 as that ID.
  • getUserInfo is needed for setup, so if the gateway rejected the new field, setup would fail.
    This branch has not been run against the live API yet. Before this PR is marked ready, we will
    confirm on our R1T that the query is accepted and returns TON-P01.
  • The integration change that uses this is a separate PR (branch up/tonneau-option-gating).

Ask for the vehicle's mobileConfiguration.tonneauOption in getUserInfo, as the app's own VehiclesAndEnrollments query does. Its optionId (TON-P01 for the powered tonneau) tells which vehicles have a tonneau cover, which supportedFeatures does not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant