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

Cli error on linux #1389

Closed
DoganM95 opened this issue Apr 9, 2022 · 4 comments · Fixed by #1390
Closed

Cli error on linux #1389

DoganM95 opened this issue Apr 9, 2022 · 4 comments · Fixed by #1390
Labels

Comments

@DoganM95
Copy link
Contributor

DoganM95 commented Apr 9, 2022

Describe the bug
Running the cli tool in linux gives an error

Version information (please complete the following information):

  • OS: Linux-Docker (FROM python:3.11.0a6-bullseye)
  • python-miio: 0.5.11

Device information:

  • Model: Redundant
  • Hardware version: Redundant
  • Firmware version: Redundant

To Reproduce
Steps to reproduce the behavior:

  1. create a dockerfile which installs python-miio==0.5.11
  2. run e.g. "miiocli dreamevacuum --help

Expected behavior
docker container should list the results

Console output

Traceback (most recent call last):
  File "/usr/local/bin/miiocli", line 5, in <module>
    from miio.cli import create_cli
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/miio/cli.py", line 43, in <module>
    cli.add_command(device_class.get_device_group())
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/miio/vacuum.py", line 841, in get_device_group
    @dg.resultcallback()
     ^^^^^^^^^^^^^^^^^^^
AttributeError: 'DeviceGroup' object has no attribute 'resultcallback'. Did you mean: 'result_callback'?

This error seems to pop up for others too recently, see this forum:
https://community.jeedom.com/t/air-purifier-3h/37012/100
https://community.jeedom.com/t/air-purifier-3h/37012/101

@0rsa
Copy link

0rsa commented Apr 10, 2022

Same error here using a fresh install of Debian Bullseye with latest miiocli and python 3.9

miiocli --help

Traceback (most recent call last): File "/usr/local/bin/miiocli", line 5, in <module> from miio.cli import create_cli File "/usr/local/lib/python3.9/dist-packages/miio/cli.py", line 43, in <module> cli.add_command(device_class.get_device_group()) File "/usr/local/lib/python3.9/dist-packages/miio/integrations/vacuum/roborock/vacuum.py", line 932, in get_device_group @dg.resultcallback() AttributeError: 'DeviceGroup' object has no attribute 'resultcallback'

@ArrEssJay
Copy link

ArrEssJay commented Apr 11, 2022

Confirmed on macos too

As a workaround just remove the offending @dg.resultcallback() reference

miiocli

Traceback (most recent call last):
  File "/usr/local/bin/miiocli", line 5, in <module>
    from miio.cli import create_cli
  File "/usr/local/lib/python3.9/site-packages/miio/cli.py", line 43, in <module>
    cli.add_command(device_class.get_device_group())
  File "/usr/local/lib/python3.9/site-packages/miio/integrations/vacuum/roborock/vacuum.py", line 932, in get_device_group
    @dg.resultcallback()
AttributeError: 'DeviceGroup' object has no attribute 'resultcallback'

@DoganM95
Copy link
Contributor Author

Quick update, opened a PR, is merged now and should work.
I guess we will have to wait for the next release 0.5.12 of miio for this fix to be released.

Until then, you can manually fix it with this terminal command:

sed -i 's/resultcallback/result_callback/g' /usr/local/lib/python3.8/dist-packages/miio/integrations/vacuum/roborock/vacuum.py

make sure to change python3.8 in the path to the version you are getting the error for.

@0rsa
Copy link

0rsa commented Apr 11, 2022

I updated vacuum.py according to the PR and I can confirm it works.
Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants