Skip to content

Commit 51ebe2e

Browse files
committed
Fix changed VW api
- /vehicles/<vin>/selectivestatus?jobs=all not supported anymore - use jobs=fuelStatus,measurements instead
1 parent 686f07a commit 51ebe2e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pvcontrol/car.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ def __init__(self, config: VolkswagenIDCarConfig):
192192
super().__init__(config)
193193
self._client = None
194194
self._vin = config.vin
195+
# additional jobs: charging, climatisation
196+
self._carStatusUrl = f"{VolkswagenIDCar.mobile_api_uri}/vehicles/{self._vin}/selectivestatus?jobs=fuelStatus,measurements"
195197

196198
@classmethod
197199
def _login(cls, user: str, password: str) -> OAuth2Session:
@@ -312,11 +314,11 @@ def _read_data(self) -> CarData:
312314

313315
# TODO: get vin if not configured
314316
if self._client is not None:
315-
status_res = self._client.get(f"{VolkswagenIDCar.mobile_api_uri}/vehicles/{self._vin}/selectivestatus?jobs=all")
317+
status_res = self._client.get(self._carStatusUrl)
316318
if status_res.status_code == 401:
317319
# auth error -> refresh token
318320
VolkswagenIDCar._refresh_token(self._client)
319-
status_res = self._client.get(f"{VolkswagenIDCar.mobile_api_uri}/vehicles/{self._vin}/selectivestatus?jobs=all")
321+
status_res = self._client.get(self._carStatusUrl)
320322
status_res.raise_for_status()
321323
status = status_res.json()
322324
# print(f"{status}")

0 commit comments

Comments
 (0)