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

Unable to verify OTP in config_builder in version 0.3.3 #16

Open
Scaredycrow opened this issue Jan 6, 2022 · 1 comment
Open

Unable to verify OTP in config_builder in version 0.3.3 #16

Scaredycrow opened this issue Jan 6, 2022 · 1 comment

Comments

@Scaredycrow
Copy link

Hi there, as per my comment in a previous issue I can now run the config_builder but it's failing when verifying the OTP.

Steps to repro:

  • Upgraded 0.3.2 to 0.3.3 using dpkg -i
  • Confirmed prometheus_client up to date with PIP
  • run config_builder
  • Enter user
  • Enter password
  • receive OTP to email
  • Enter OTP in terminal

Error:
Enter OTP: 221443 Traceback (most recent call last): File "/tmp/Bazel.runfiles_1xfvuosz/runfiles/__main__/config_builder.py", line 181, in <module> main(sys.argv) File "/tmp/Bazel.runfiles_1xfvuosz/runfiles/__main__/config_builder.py", line 170, in main devices = _query_dyson(creds) File "/tmp/Bazel.runfiles_1xfvuosz/runfiles/__main__/config_builder.py", line 73, in _query_dyson verify_fn(otp, creds.password) File "/tmp/Bazel.runfiles_1xfvuosz/runfiles/pip/pypi__libdyson/libdyson/cloud/account.py", line 145, in _verify response = self.request( File "/tmp/Bazel.runfiles_1xfvuosz/runfiles/pip/pypi__libdyson/libdyson/cloud/account.py", line 113, in request raise DysonInvalidAuth libdyson.exceptions.DysonInvalidAuth

@seanrees
Copy link
Owner

seanrees commented Jan 9, 2022

Thanks for the bug report.

This is unfortunately a known issue in libdyson (see shenxn/libdyson#15). My intuition is that the Dyson login flow, which AIUI is an unpublished API, has changed and the existing pathway is unreliable. My hope is that libdyson will reverse engineer whatever changes are needed and we'll come along for the ride at some point in future.

With that said, are you blocked from using prometheus-dyson at all? If so -- I just released 0.3.4 and this includes a new flag for config_builder: --mode=wifi. This will let you generate a config based on the label details on the device. This is also relying on libdyson code, and works for my fan, but not sure how well it works across Dyson's whole range. :/

Example flow:

% config_builder --config=new.ini --mode=wifi
This requires the WiFi credentials from the label on the Dyson
device. This will be used to calculate the secret required
to connect to this device locally. This script does NOT need
to modify WiFi settings in any way.

The product SSID might look like: DYSON-AB0-XX-ABC1234D-123

Enter product SSID            : DYSON-AB0-ZZ-ABC1234D-999
Enter product WiFi password   : abcdefgh
Device name (e.g; Living Room): My Fan

Configuration generated; press return to view.
[Hosts]

[PE9-UK-KJA2271A]
name = My Fan
serial = AB0-ZZ-ABC1234D
localcredentials = random-string==
producttype = 999

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

2 participants