Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mesh 'NoneType' if confflow empty #39

Merged
merged 1 commit into from
Nov 23, 2024
Merged

Conversation

FaserF
Copy link
Contributor

@FaserF FaserF commented Nov 23, 2024

After updating to V0.2.0 I noticed the following error:

Device [AX3600] async_update_data error: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/config/custom_components/openwrt/coordinator.py", line 330, in async_update_data
    result['mesh'] = await self.update_mesh(wireless_config['mesh'])
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openwrt/coordinator.py", line 105, in update_mesh
    for mac in self.find_mesh_peers(conf['mesh_id']):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openwrt/coordinator.py", line 77, in find_mesh_peers
    for _, mesh in data['mesh'].items():
                   ~~~~^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

This PR fixes this. The reason is that I left mesh empty at config flow, but I am using mesh.

@kvj kvj merged commit 474a096 into kvj:main Nov 23, 2024
@kvj
Copy link
Owner

kvj commented Nov 23, 2024

Thanks, bumped version to 0.2.1

@FaserF FaserF deleted the fix-mesh-nonetype branch November 23, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants