Andre0512 / speedport

Home Assistant integration for Telekom Speedport
MIT License
22 stars 6 forks source link

buttons become unclickable #3

Closed DFS-90 closed 10 months ago

DFS-90 commented 10 months ago

Hey,

I want to report a third issue that happened to me:

After having installed the HACS plugin, the different buttons (e. g. "reboot", "wifi" buttons) became available. Some minutes later, they became grey and unclickable.

Checking out the logs I found the following errors (hope that helps):

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.speedport.device Source: helpers/update_coordinator.py:290 Integration: Speedport (documentation, issues) First occurred: 14:40:26 (2603 occurrences) Last logged: 18:23:39

Unexpected error fetching Speedport Smart 4 Typ A data: list index out of range Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/speedport/device.py", line 32, in _async_update_data await asyncio.gather( File "/usr/local/lib/python3.11/site-packages/speedport/speedport.py", line 105, in update_ip_data self._ip_data = await self.api.get_ip_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/speedport/api.py", line 20, in inner await self.api.login(self.password) File "/usr/local/lib/python3.11/site-packages/speedport/connection.py", line 126, in login login_data = f"{await self._get_login_key()}:{password}".encode() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/speedport/connection.py", line 119, in _get_login_key if response := await self.post("data/Login.json", data, "/"): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/speedport/connection.py", line 100, in post data.update({"httoken": await self._get_httoken(referer)}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/speedport/connection.py", line 115, in _get_httoken return re.findall("_httoken = (\d+)", await response.text())[0]


IndexError: list index out of range

Logger: homeassistant.components.switch
Source: helpers/entity_platform.py:359
Integration: Schalter (documentation, issues)
First occurred: 14:40:22 (2 occurrences)
Last logged: 15:12:18

Error while setting up speedport platform for switch
Traceback (most recent call last):
 File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
   await asyncio.shield(task)
 File "/config/custom_components/speedport/switch.py", line 26, in async_setup_entry
   await asyncio.gather(*[speedport.update_status(), speedport.update_ip_data()])
 File "/usr/local/lib/python3.11/site-packages/speedport/speedport.py", line 105, in update_ip_data
   self._ip_data = await self.api.get_ip_data()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/local/lib/python3.11/site-packages/speedport/api.py", line 20, in inner
   await self.api.login(self.password)
 File "/usr/local/lib/python3.11/site-packages/speedport/connection.py", line 126, in login
   login_data = f"{await self._get_login_key()}:{password}".encode()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/local/lib/python3.11/site-packages/speedport/connection.py", line 119, in _get_login_key
   if response := await self.post("data/Login.json", data, "/"):
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/local/lib/python3.11/site-packages/speedport/connection.py", line 100, in post
   data.update({"httoken": await self._get_httoken(referer)})
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/local/lib/python3.11/site-packages/speedport/connection.py", line 115, in _get_httoken
   return re.findall("_httoken = (\\d+)", await response.text())[0]
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Do you have an idea how to fix this?

Thanks for your great work and best regards, David

Andre0512 commented 10 months ago

Hey, I think I found the issue. Please try v0.3.1 :slightly_smiling_face:

DFS-90 commented 10 months ago

Just installed v0.3.1 - seems to do the trick! I will monitor further and report back. Thanks for your efforts! 😃

Andre0512 commented 10 months ago

Nice, thanks for testing :smiley: