DasBasti / SmartHashtag

Homeassistant component for Smart #1/#3 API
MIT License
29 stars 0 forks source link

Since v0.3.6 error after restarting HA #111

Closed detLAN closed 3 weeks ago

detLAN commented 1 month ago

Ich schreibe einfach mal auf Deutsch. Nach dem ich Version 0.3.6 installiert habe, bekomme ich nach einem Neustrat von HA folgende Fehlermeldungen: `Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.smarthashtag Quelle: helpers/update_coordinator.py:312 Integration: Smart (Dokumentation, Probleme) Erstmals aufgetreten: 21:21:39 (1 Vorkommnisse) Zuletzt protokolliert: 21:21:39

Unexpected error fetching smarthashtag data Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pysmarthashtag/api/authentication.py", line 236, in _login auth_result = httpx.URL(r_auth.headers["location"])


  File "/usr/local/lib/python3.12/site-packages/httpx/_models.py", line 228, in __getitem__
    raise KeyError(key)
KeyError: 'location'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smarthashtag/coordinator.py", line 42, in _async_update_data
    return await self.account.get_vehicles()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmarthashtag/account.py", line 101, in get_vehicles
    await self.config.authentication.login()
  File "/usr/local/lib/python3.12/site-packages/pysmarthashtag/api/authentication.py", line 122, in login
    token_data = await self._login()
                 ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmarthashtag/api/authentication.py", line 240, in _login
    raise SmartAPIError("Could not get access token from auth page")
pysmarthashtag.models.SmartAPIError: Could not get access token from auth page`

`Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.smarthashtag
Quelle: helpers/update_coordinator.py:312
Integration: Smart (Dokumentation, Probleme)
Erstmals aufgetreten: 21:22:01 (1 Vorkommnisse)
Zuletzt protokolliert: 21:22:01

Unexpected error fetching smarthashtag data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smarthashtag/coordinator.py", line 42, in _async_update_data
    return await self.account.get_vehicles()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmarthashtag/account.py", line 101, in get_vehicles
    await self.config.authentication.login()
  File "/usr/local/lib/python3.12/site-packages/pysmarthashtag/api/authentication.py", line 122, in login
    token_data = await self._login()
                 ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmarthashtag/api/authentication.py", line 262, in _login
    api_access_token = api_result["data"]["accessToken"]
                       ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable`

Falls Du noch etwas benötigst, lass es mich wissen.

Beste Grüße aus dem Norden
Detlef
DasBasti commented 1 month ago

Hi Detlef, bekommst du ausschließlich diesen Fehler, oder geht die Integration trotzdem? Die Fehler kommen, wenn von der Smart Webseite unerwartete/keine Antworten kommen.

detLAN commented 1 month ago

Hi Detlef, bekommst du ausschließlich diesen Fehler, oder geht die Integration trotzdem? Die Fehler kommen, wenn von der Smart Webseite unerwartete/keine Antworten kommen.

Moin Bastian, der Fehler kommt ausschließlich beim Neustart von HA, die Integration funktioniert anschließend jedoch problemlos.

DasBasti commented 1 month ago

ok, danke. Ich schau es mir näher an.

DasBasti commented 3 weeks ago

Fix in 40b7cdc9055ac43de8bb1a5c2d432137f8da170d