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

Error when running get_devices.py #34

Open
tkm5 opened this issue Nov 10, 2022 · 6 comments
Open

Error when running get_devices.py #34

tkm5 opened this issue Nov 10, 2022 · 6 comments

Comments

@tkm5
Copy link

tkm5 commented Nov 10, 2022

Error when running get_devices.py
What should I do?

Error log

$ python3 get_devices.py
Please choose your account region
1: Mainland China
2: Rest of the World
Region [1/2]: 2
Region code: JP
Email: [email protected]
Traceback (most recent call last):
File "/home/takumig/libdyson/get_devices.py", line 22, in
verify = account.login_email_otp(email, region)
File "/home/takumig/libdyson/libdyson/cloud/account.py", line 122, in login_email_otp
response = self.request(
File "/home/takumig/libdyson/libdyson/cloud/account.py", line 114, in request
raise DysonInvalidAuth
libdyson.exceptions.DysonInvalidAuth

@shadyabhi
Copy link

+1. For me, the error is about the attr module.

shadyabhi@nuc10i7fnh:~/libdyson$ python3 get_devices.py
Traceback (most recent call last):
  File "get_devices.py", line 3, in <module>
    from libdyson.cloud import DysonAccount
  File "/home/shadyabhi/libdyson/libdyson/cloud/__init__.py", line 3, in <module>
    from .account import DysonAccount, DysonAccountCN  # noqa: F401
  File "/home/shadyabhi/libdyson/libdyson/cloud/account.py", line 19, in <module>
    from .device_info import DysonDeviceInfo
  File "/home/shadyabhi/libdyson/libdyson/cloud/device_info.py", line 5, in <module>
    import attr
ModuleNotFoundError: No module named 'attr'
shadyabhi@nuc10i7fnh:~/libdyson$ git show
commit 3137808d801c9192794b0ff9a0ea25cd5dbea8b8 (HEAD -> main, tag: v0.8.11, origin/main, origin/HEAD)
Author: Sami Taaissat <[email protected]>
Date:   Fri Apr 8 20:14:42 2022 +0200

    bump setup.cfg

diff --git a/setup.cfg b/setup.cfg
index 45b520b..2fdce11 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
 [metadata]
 name = libdyson
-version = 0.8.10
+version = 0.8.11
 author = Xiaonan Shen
 author_email = [email protected]
 license = MIT License
shadyabhi@nuc10i7fnh:~/libdyson$

@patate-pilees
Copy link

patate-pilees commented Jan 9, 2023

@shenxn I get the same error as @tkm5, for the past few days that I tried this... basically the Dyson server is giving a HTTP response code 401 "Unauthorized"...

@shadyabhi have you imported the "attrs" module? If this is the problem, you will be able to get to the other error above [tkm5] I think!

@shadyabhi
Copy link

shadyabhi commented Jan 9, 2023

@shadyabhi have you imported the "attrs" module? If this is the problem, you will be able to get to the other error above [tkm5] I think!

get_devices.py is part of the official repo itself, so I would expect it to work as is! I personally didn't spend time debugging what has changed in recent months. As a consumer, I would expect the script to work as is, after the clone.

I'm pretty sure it used to work earlier because that's how I got the Dyson password the first time I set it up a few months ago.

@patate-pilees
Copy link

@shadyabhi have you imported the "attrs" module? If this is the problem, you will be able to get to the other error above [tkm5] I think!

get_devices.py is part of the official repo itself, so I would expect it to work as is! I personally didn't spend time debugging what has changed in recent months. As a consumer, I would expect the script to work as is, after the clone.

I'm pretty sure if used to work earlier because that's how I got the Dyson password the first time I set it up a few months ago.

Ok, I mentioned it because the error seemed related to the attrs module, and that it is specifically required in the "requirements.txt" file that we're instructed to import first.

@mtjweb
Copy link

mtjweb commented Mar 13, 2023

Log out off the MyDyson app and try again, it solved the problem for me.

@jorisc90
Copy link

Log out off the MyDyson app and try again, it solved the problem for me.

This solved the issue for me! Thanks mjtweb!

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

No branches or pull requests

5 participants