BenPru / luxtronik

Luxtronik integration for Home Assistant
MIT License
66 stars 23 forks source link

Error: Could not handle config_flow.async_step_dhcp #237

Closed DrBlokmeister closed 4 months ago

DrBlokmeister commented 4 months ago

I've been using this integration happily for quite some time now. However, I often (one to a few times per day) find log errors referring to this component, and I don't know what this means. The integration seems to work fine otherwise. I want to know if this is something that I can fix. The error is below:

2024-01-20 11:10:11.552 INFO (MainThread) [custom_components.luxtronik2] Found device with hostname '' IP 'X.X.X.X'
2024-01-20 11:10:15.556 ERROR (MainThread) [custom_components.luxtronik2] Could not handle config_flow.async_step_dhcp DhcpServiceInfo(ip='X.X.X.X', hostname='', macaddress='XXXXXXXXXXXX')
Traceback (most recent call last):
  File "/config/custom_components/luxtronik2/config_flow.py", line 256, in async_step_dhcp
    broadcast_discover_ip, broadcast_discover_port = discover()[0]
                                                     ~~~~~~~~~~^^^
IndexError: list index out of range
2024-01-20 11:10:15.654 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/discovery_flow.py", line 96, in _async_start
    await gather_with_limited_concurrency(
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 187, in gather_with_limited_concurrency
    return await gather(
           ^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 185, in sem_task
    return await task
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 880, in async_init
    flow, result = await task
                   ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 908, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 396, in _async_handle_step
    if result.get("preview") is not None:
       ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

Again, the integration seems to work fine for the most part. If there are hiccups or glitches, I am unaware of them. I'm just trying to find out if I can fix this error reporting.

BenPru commented 4 months ago

I think it is the same as #216 and #220

DrBlokmeister commented 4 months ago

Good catch! I think so too. I'm closing it.