Skip to content

Fix dump_devinfo for unauthenticated #593

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

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

sdb9696
Copy link
Collaborator

@sdb9696 sdb9696 commented Dec 29, 2023

Fixes #591

Will convert from draft once rebased on top of #569

Copy link

codecov bot commented Dec 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f6fd898) 85.01% compared to head (8b021e0) 84.94%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #593      +/-   ##
==========================================
- Coverage   85.01%   84.94%   -0.07%     
==========================================
  Files          38       38              
  Lines        3389     3387       -2     
  Branches      851      851              
==========================================
- Hits         2881     2877       -4     
- Misses        422      424       +2     
  Partials       86       86              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I'll take give it a test on a test device and merge after we get the deviceinfo PR in!

@sdb9696 sdb9696 marked this pull request as ready for review December 29, 2023 19:31
@rytilahti
Copy link
Member

rytilahti commented Dec 29, 2023

Tested to work on both tapo devices I have, legacy fixture support seems to have regressed unnoticed (DiscoveryResult expects 20002-style response which 9999 doesn't have), too:

  File "/home/tpr/code/python-kasa/devtools/dump_devinfo.py", line 112, in cli
    save_filename, copy_folder, final = await get_legacy_fixture(device)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tpr/code/python-kasa/devtools/dump_devinfo.py", line 186, in get_legacy_fixture
    dr = DiscoveryResult(**device._discovery_info)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 6 validation errors for DiscoveryResult
device_type
  field required (type=value_error.missing)
device_model
  field required (type=value_error.missing)
ip
  field required (type=value_error.missing)
mac
  field required (type=value_error.missing)
mgt_encrypt_schm
  field required (type=value_error.missing)
device_id
  field required (type=value_error.missing)
Exception ignored in: <function StreamWriter.__del__ at 0x7f1f53f88f40>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/streams.py", line 395, in __del__
  File "/usr/lib/python3.11/asyncio/streams.py", line 343, in close
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 860, in close
  File "/usr/lib/python3.11/asyncio/base_events.py", line 761, in call_soon
  File "/usr/lib/python3.11/asyncio/base_events.py", line 519, in _check_closed
RuntimeError: Event loop is closed

As that is not relevant to the PR at hand, let's merge this. Thanks @sdb9696!

@rytilahti rytilahti merged commit 1b79142 into python-kasa:master Dec 29, 2023
@sdb9696 sdb9696 deleted the fix_aeslogin_error branch February 20, 2024 09:47
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.

dump_devinfo crashes when credentials are not given
2 participants