Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/rivian/rivian.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,15 +477,15 @@ async def get_live_charging_session(
for p in properties
)
graphql_query = f"""
query getLiveSessionData($vehicleId: ID!) {{
getLiveSessionData(vehicleId: $vehicleId) {{
query getLiveSessionHistory($vehicleId: ID!) {{
getLiveSessionHistory(vehicleId: $vehicleId) {{
__typename
{fragment}
}}
}}"""

graphql_json = {
"operationName": "getLiveSessionData",
"operationName": "getLiveSessionHistory",
"query": graphql_query,
"variables": {"vehicleId": vin},
}
Expand Down
1 change: 0 additions & 1 deletion src/rivian/schemas/charging.graphql
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
type Query {
chargepoint: ChargepointQuery
getCompletedSessionSummaries($vehicleId: String): [ChargingSessionSummary]
getLiveSessionData(vehicleId: ID!): LiveSessionData
getLiveSessionHistory(vehicleId: ID!): LiveSessionHistory
getNonRivianUserSession: NonRivianUserSessionData
getRegisteredWallboxes: [WallboxRecord]
Expand Down
2 changes: 1 addition & 1 deletion tests/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
LIVE_CHARGING_SESSION_RESPONSE = {
"data": {
"getLiveSessionData": {
"getLiveSessionHistory": {
"isRivianCharger": None,
"isFreeSession": None,
"vehicleChargerState": {
Expand Down
4 changes: 2 additions & 2 deletions tests/rivian_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ async def test_get_vehicle_state(aresponses: ResponsesMockServer) -> None:


async def test_get_live_charging_session(aresponses: ResponsesMockServer) -> None:
"""Test GraphQL Response for a getLiveSessionData request"""
"""Test GraphQL Response for a getLiveSessionHistory request"""
aresponses.add(
"rivian.com",
"/api/gql/chrg/user/graphql",
Expand All @@ -188,7 +188,7 @@ async def test_get_live_charging_session(aresponses: ResponsesMockServer) -> Non
response_json = await response.json()
assert response.status == 200
assert (
response_json["data"]["getLiveSessionData"]["vehicleChargerState"]["value"]
response_json["data"]["getLiveSessionHistory"]["vehicleChargerState"]["value"]
== "charging_active"
)
await rivian.close()
Expand Down