8000 Update dump_devinfo to include 20002 discovery results by sdb9696 · Pull Request #556 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

Update dump_devinfo to include 20002 discovery results #556

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 3 commits into from
Nov 29, 2023

Conversation

sdb9696
Copy link
Collaborator
@sdb9696 sdb9696 commented Nov 28, 2023

Updated dump_devinfo to capture the 20002 discovery result if present and save it in the fixtures file. This will be used for testing, for example to ensure that the correct fake protocol is used for tapo devices.

N.B. dump_devinfo didn't seem to be working as it imported non-async click which isn't installed by poetry so I updated it to async_click

Copy link
codecov bot commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9728866) 82.27% compared to head (8981bf5) 82.29%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #556      +/-   ##
==========================================
+ Coverage   82.27%   82.29%   +0.01%     
==========================================
  Files          30       30              
  Lines        2466     2468       +2     
  Branches      694      694              
==========================================
+ Hits         2029     2031       +2     
  Misses        379      379              
  Partials       58       58              

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

@sdb9696 sdb9696 force-pushed the update_dump_devinfo branch from 63c0dba to a077f19 Compare November 28, 2023 18:04
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.

Some comments, I'll use this PR to create a fixture for my new L530 soon :-)

"ssid",
"hw_id",
"fw_id",
"oem_id",
Copy link
Member

Choose a reason for hiding this comment

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

This looks good to me for now, but we will probably want to move the list of keys to scrub (including the ones below) into the library itself. This will allow removing the hardcoded list from homeassistant integration: https://github.com/home-assistant/core/blob/b36ddaa15c5975fbae36e2b4eef9721ef45f1a35/homeassistant/components/tplink/diagnostics.py#L14

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.

Tested to work on KL130 and HS110 using the legacy, raises an error though after saving the results, unsure if related:

Exception ignored in: <function StreamWriter.__del__ at 0x7fcdb9dd8180>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/streams.py", line 395, in __del__
    self.close()
  File "/usr/lib/python3.11/asyncio/streams.py", line 343, in close
    return self._transport.close()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 860, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "/usr/lib/python3.11/asyncio/base_events.py", line 761, in call_soon
    self._check_closed()
  File "/usr/lib/python3.11/asyncio/base_events.py", line 519, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

@sdb9696 sdb9696 force-pushed the update_dump_devinfo branch from b54dba6 to ff76471 Compare November 29, 2023 16:27
@sdb9696
Copy link
Collaborator Author
sdb9696 commented Nov 29, 2023

Thanks. I've rebased to master so should be ready to merge.

@rytilahti rytilahti changed the title Fix dump_devinfo and add discovery_result to json Update dump_devinfo to include 20002 discovery results Nov 29, 2023
@rytilahti rytilahti added the enhancement New feature or request label Nov 29, 2023
@rytilahti rytilahti merged commit 9de3f69 into python-kasa:master Nov 29, 2023
@sdb9696 sdb9696 deleted the update_dump_devinfo branch December 6, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0