CJNE / pyporscheconnectapi

Python client library for Porsche Connect API
MIT License
44 stars 9 forks source link

Car in privacy mode gives error #38

Closed MarkusGH closed 7 months ago

MarkusGH commented 7 months ago

Trying

porschecli overview -v "WP1ZZZ..."

while car is in privacy mode gives me

Traceback (most recent call last):
  File "/usr/local/bin/porschecli", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.8/dist-packages/pyporscheconnectapi/cli.py", line 270, in cli
    loop.run_until_complete(main(args))
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/dist-packages/pyporscheconnectapi/cli.py", line 67, in main
    data = await client.getCurrentOverview(vin)
  File "/usr/local/lib/python3.8/dist-packages/pyporscheconnectapi/client.py", line 464, in getCurrentOverview
    f"https://api.porsche.com/service-vehicle/{self.locale_str}/vehicle-data/{vin}/current/request/{progressResult['requestId']}/status"
KeyError: 'requestId'
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fcbcc275520>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fcbcc2918e0>, 5172133.566873318)]', '[(<aiohttp.client_proto.ResponseHandler object at 0x7fcbcc2554c0>, 5172133.873355753)]']
connector: <aiohttp.connector.TCPConnector object at 0x7fcbcc2756a0>
Yesterday and the day before already errors, but manual login and solving the captcha helped.
Today it dies not helt anymore.

Maybe it would be a good idea to detect privacy mode.

porschecli services-v "WP1ZZZ..." returns successful even in privacy mode.