Skip to content

Failed loading integration when wifi does not have a network entry from ubus #44

@dmickeyus

Description

@dmickeyus

I have a mesh where does not have an entry of 'network' from ubus caused HA won't load the integration.

Log reported from HA:

2024-12-29 22:33:12.180 ERROR (MainThread) [custom_components.openwrt.coordinator] Device [xxx] async_update_data error: 'network'
Traceback (most recent call last):
File "/config/custom_components/openwrt/coordinator.py", line 333, in async_update_data
wireless_config = await self.discover_wireless()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/openwrt/coordinator.py", line 63, in discover_wireless
network=iface['config']['network'][0])
~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'network'


I tried to remove the network entity from the dict on line 63 and temporarily fxied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions