CJNE / ha-porscheconnect

Porsche Connect custom component for Home Assistant
MIT License
29 stars 12 forks source link

IndexError: tuple index out of range #184

Closed farawayz closed 1 year ago

farawayz commented 1 year ago

Version of the custom_component

0.0.13

Configuration

n/a

Describe the bug

integration porscheconnect is generation the following Error in the Log.

Debug log

2023-06-14 23:01:51.272 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry ***** for porscheconnect Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/porscheconnect/init.py", line 94, in async_setup_entry access_tokens = await controller.getAllTokens() File "/usr/local/lib/python3.10/site-packages/pyporscheconnectapi/client.py", line 32, in getAllTokens return await self._connection.getAllTokens() File "/usr/local/lib/python3.10/site-packages/pyporscheconnectapi/connection.py", line 135, in getAllTokens token = await self._requestToken(application) File "/usr/local/lib/python3.10/site-packages/pyporscheconnectapi/connection.py", line 167, in _requestToken last_location = resp.history[len(resp.history) - 1].headers["Location"] IndexError: tuple index out of range

sbrewster2 commented 1 year ago

Same issue for me since upgrade to v 0.14. Have tried a restart of HA, the error remains.

Was working ok on v 0.13

2023-06-15 10:34:59.627 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry ** for porscheconnect Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/manual_porscheconnect/init.py", line 94, in async_setup_entry access_tokens = await controller.getAllTokens() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyporscheconnectapi/client.py", line 32, in getAllTokens return await self._connection.getAllTokens() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyporscheconnectapi/connection.py", line 135, in getAllTokens token = await self._requestToken(application) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyporscheconnectapi/connection.py", line 167, in _requestToken last_location = resp.history[len(resp.history) - 1].headers["Location"]


IndexError: tuple index out of range
sbrewster2 commented 1 year ago

Just checked this issue using a simple python script on my Windows PC using pyporscheconnect and was getting the exact same error.

Upgraded pyporscheconnect to 0.1.2 and the problem has gone.

So seems we just need to get the version of the python pyporscheconnect library updated in HACS. (Just off to google that!)

CJNE commented 1 year ago

Hi, the latest version 0.0.14, is using the updated pyporscheconnect library that works with the new auth.

CJNE commented 1 year ago

0.0.14 had problems still, the new version 0.0.15 should work.