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 object not found #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

FaserF
Copy link

@FaserF FaserF commented Aug 27, 2024

This fixes the following two issues, most likely occurring due to WIFI interfaces with no clients.

Traceback (most recent call last):
  File "/config/custom_components/openwrt/coordinator.py", line 300, in async_update_data
    result['wireless'] = await self.update_ap(wireless_config['ap'])
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openwrt/coordinator.py", line 227, in update_ap
    result[item['ifname']] = await self.update_hostapd_clients(item['ifname'])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openwrt/coordinator.py", line 131, in update_hostapd_clients
    for key, value in response['clients'].items():
                      ~~~~~~~~^^^^^^^^^^^
KeyError: 'clients'
Traceback (most recent call last):
  File "/config/custom_components/openwrt/coordinator.py", line 300, in async_update_data
    result['wireless'] = await self.update_ap(wireless_config['ap'])
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openwrt/coordinator.py", line 227, in update_ap
    result[item['ifname']] = await self.update_hostapd_clients(item['ifname'])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openwrt/coordinator.py", line 125, in update_hostapd_clients
    response = await self._ubus.api_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openwrt/ubus.py", line 41, in api_call
    return await self._api_call(rpc_method, subsystem, method, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openwrt/ubus.py", line 109, in _api_call
    raise NameError(message)
NameError: Object not found

This will most likely fix: #24

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.

Issues when connecting to router
1 participant