uvjim / linksys_velop

Home Assistant integration for the Linksys Velop
47 stars 6 forks source link

Error Setting Up on Restart #433

Closed spiralfive closed 1 year ago

spiralfive commented 1 year ago

I just set this integration up - and everything seemingly works (I have entities reporting correct status/etc) up until I restart Home Assistant or the integration. Once I do that, the integration will not start. The error below is showing up in the logs over and over.

Unexpected error fetching linksys_velop data: coroutine raised StopIteration
Traceback (most recent call last):
  File "/config/custom_components/linksys_velop/__init__.py", line 294, in _async_get_mesh_data
    previous_nodes_serials: Set[str] = {
                                       ^
  File "/config/custom_components/linksys_velop/__init__.py", line 295, in <setcomp>
    next(iter(prev_node.identifiers))[1]  # serial number of node
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 242, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: coroutine raised StopIteration

I'm using the 2023.7.1 version of the integration. My Home Assistant details are below. The Linksys hardware I am using is x2 MR7300 routers, if that helps.

Home Assistant 2023.7.3
Supervisor 2023.07.1
Operating System 10.3
Frontend 20230705.1 - latest

Another thing I noticed and may be related - I cannot get my iPhone to show up after adding it as a device tracker. The other devices work fine. However, the error above appears regardless of me adding the iPhone or not. If I add 5 devices to track, I see 4 entities created - the iPhone missing.

image

image

uvjim commented 1 year ago

I'll tackle the Exception first. I can't recreate this but I have caught it and added some more debugging. I'll release the beta tomorrow for you to test.

spiralfive commented 1 year ago

Is the new version the 2023.7.1b1 version? If it’s released. I can’t find a release date, though I am on my phone and might be overlooking it.

uvjim commented 1 year ago

Life got in the way yesterday.

2023.7.2b0 is out now. I've added an additional debug line in which may help if the issue continues. If you still get the error please turn on debug logging (you can do this either in the configure option of the integration or in config,yaml) and then provide the debug log so I can take a look.

spiralfive commented 1 year ago

Thank you! I downloaded it early this morning and have restarted several times. The integration and Home Assistant. I don’t seem to be able to reproduce the error now. My iPhone will still not show up (there is no entity created), but I am not seeing any errors in the logs.

uvjim commented 1 year ago

That's good. For the iPhone; could you check if a disabled device_tracker has been created? Home Assistant creates them as disabled unless it already knows about a connection. If it is disabled you should just be able to enable it. It should then work as expected.

spiralfive commented 1 year ago

That was it! All the others seemed to come in Enabled by default. Thank you for your help, I think everything is working now.