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

AttributeError: 'list' object has no attribute 'values' #38870

Closed
tiagofreire-pt opened this issue Aug 14, 2020 · 5 comments · Fixed by #39561
Closed

AttributeError: 'list' object has no attribute 'values' #38870

tiagofreire-pt opened this issue Aug 14, 2020 · 5 comments · Fixed by #39561
Assignees

Comments

@tiagofreire-pt
Copy link
Contributor

The problem

The integration crashes and device tracking is not working anymore until a full HA reboot.

Environment

  • Home Assistant Core release with the issue: 0.114.0
  • Last working Home Assistant Core release (if known): N/K
  • Operating environment (OS/Container/Supervised/Core): Core
  • Integration causing this issue: OpenWRT luci
  • Link to integration documentation on our website:

Problem-relevant configuration.yaml

device_tracking:
  - platform: luci
    host: !secret openwrt_host
    username: !secret openwrt_username
    password: !secret openwrt_password

Traceback/Error logs

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py", line 161, in async_device_tracker_scan
    found_devices = await scanner.async_scan_devices()
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 482, in async_scan_devices
    return await self.hass.async_add_job(self.scan_devices)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/luci/device_tracker.py", line 63, in scan_devices
    self._update_info()
  File "/usr/src/homeassistant/homeassistant/components/luci/device_tracker.py", line 91, in _update_info
    result = self.router.get_all_connected_devices(only_reachable=True)
  File "/usr/local/lib/python3.8/site-packages/openwrt_luci_rpc/__init__.py", line 42, in get_all_connected_devices
    return self.router.get_all_connected_devices(
  File "/usr/local/lib/python3.8/site-packages/openwrt_luci_rpc/openwrt_luci_rpc.py", line 175, in get_all_connected_devices
    device_entry['hostname'] = utilities.get_hostname_from_dhcp(
  File "/usr/local/lib/python3.8/site-packages/openwrt_luci_rpc/utilities.py", line 27, in get_hostname_from_dhcp
    host = [x for x in dhcp_result.values()
AttributeError: 'list' object has no attribute 'values'

Additional information

Using on a Linksys EA7300, OpenWrt SNAPSHOT r14139-91aab77bf1.

@probot-home-assistant
Copy link

luci documentation
luci source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @fbradyirl, @mzdrale, mind taking a look at this issue as its been labeled with an integration (luci) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

fbradyirl pushed a commit to fbradyirl/openwrt-luci-rpc that referenced this issue Sep 1, 2020
@fbradyirl
Copy link
Contributor

Fixed in v1.1.6 which is build but pypi is having issues with deploy.
https://travis-ci.community/t/pypi-upload-failed/9790

fbradyirl/openwrt-luci-rpc@v1.1.5...v1.1.6

@tiagofreire-pt
Copy link
Contributor Author

tiagofreire-pt commented Sep 1, 2020

Fixed in v1.1.6 which is build but pypi is having issues with deploy.
https://travis-ci.community/t/pypi-upload-failed/9790

fbradyirl/openwrt-luci-rpc@v1.1.5...v1.1.6

Awesome!

Would you kindly check if the 1.1.7 is now fully updated on pypi and bump the dependancy on HA to that version?

@fbradyirl
Copy link
Contributor

PR opened #39561

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue Oct 6, 2022
https://build.opensuse.org/request/show/1008149
by user dgarcia + RBrownFactory
- Update to 1.1.12 (2022-09-11)
  * Includes latest fixes to support newer versions of OpenWrt
- Update to 1.1.11 (2021-03-21)
  * Add rst-linter pre-commit hook to prevent committing errors to HISTORY.rst #50
- Update to 1.1.10 (2021-03-21)
  * Also trigger the Github Actions on push of tags (#49)
- Update to 1.1.9 (2021-03-21)
  * Publish to pypi only once in github actions (#47)
- Update to 1.1.8 (2021-03-12)
  * Support newer openwrt snapshot versions (#45)
  * Fix tox in github actions and also test py38 (#46)
- Update to 1.1.7 (2020-12-08)
  * Switch pipeline to Github actions
- Update to 1.1.6 (2020-09-01)
  * Fixes home-assistant/core/issues/38870, home-assistant/core/issues/39498
  * Fixes fbradyirl/openwrt-luci-rpc/issues/33
- Update to 1.1.5 (2020-09-01)
  * Unpin pip versions.
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue Jul 10, 2024
https://build.opensuse.org/request/show/1008149
by user dgarcia + RBrownFactory
- Update to 1.1.12 (2022-09-11)
  * Includes latest fixes to support newer versions of OpenWrt
- Update to 1.1.11 (2021-03-21)
  * Add rst-linter pre-commit hook to prevent committing errors to HISTORY.rst #50
- Update to 1.1.10 (2021-03-21)
  * Also trigger the Github Actions on push of tags (#49)
- Update to 1.1.9 (2021-03-21)
  * Publish to pypi only once in github actions (#47)
- Update to 1.1.8 (2021-03-12)
  * Support newer openwrt snapshot versions (#45)
  * Fix tox in github actions and also test py38 (#46)
- Update to 1.1.7 (2020-12-08)
  * Switch pipeline to Github actions
- Update to 1.1.6 (2020-09-01)
  * Fixes home-assistant/core/issues/38870, home-assistant/core/issues/39498
  * Fixes fbradyirl/openwrt-luci-rpc/issues/33
- Update to 1.1.5 (2020-09-01)
  * Unpin pip versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants