FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Convert discovery to asyncio by rytilahti · Pull Request #13 · python-kasa/python-kasa · GitHub

Repository navigation

Convert discovery to asyncio - #13

Closed
rytilahti wants to merge 2 commits into
python-kasa:masterfrom
rytilahti:async_discover
Closed

rytilahti wants to merge 2 commits into
python-kasa:masterfrom
rytilahti:async_discover

Conversation

Copy link
Copy Markdown
Member
  • Use asyncio.DatagramProtocol
  • Cleanup parameters, no more positional arguments

* Use asyncio.DatagramProtocol
* Cleanup parameters, no more positional arguments

Closes python-kasa#7
rytilahti added a commit to rytilahti/python-kasa that referenced this pull request Jan 12, 2020
* This requires python-kasa#13 to be merged. Closes python-kasa#12.
* Converts cli to use asyncio.run() where needed.
* The children from smartstrips is being initialized during the first update call.

Copy link
Copy Markdown
Contributor

I've only now noticed that the code in #14 is on top of this.

So I've already reviewed it there :)

Comment thread kasa/discover.py
async def discover(
*,
target="255.255.255.255",
on_discovered=None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

A type hint might be useful here.

OTOH it's a private class.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Indeed; this wasn't completely done. I'll make the changes in the other PR considering it already contains all of this. So I'm closing this now, thanks for the review!

rytilahti closed this Jan 12, 2020
rytilahti added a commit that referenced this pull request Jan 12, 2020
* do not update inside __repr__

* Convert discovery to asyncio

* Use asyncio.DatagramProtocol
* Cleanup parameters, no more positional arguments

Closes #7

* Remove sync interface

* This requires #13 to be merged. Closes #12.
* Converts cli to use asyncio.run() where needed.
* The children from smartstrips is being initialized during the first update call.

* Convert on and off commands to use asyncio.run

* conftest: do the initial update automatically for the device, cleans up tests a bit

* return subdevices alias for strip plugs, remove sync from docstrings

* Make tests pass using pytest-asyncio

* Simplify tests and use pytest-asyncio.
* Removed the emeter tests for child devices, as this information do not seem to exist (based on the dummy sysinfo data). Can be added again if needed.
* Remove sync from docstrings.

* Fix incorrect type hint

* Add type hints and some docstrings to discovery
pillarsdotnet pushed a commit to pillarsdotnet/python-kasa that referenced this pull request Oct 22, 2026
* do not update inside __repr__

* Convert discovery to asyncio

* Use asyncio.DatagramProtocol
* Cleanup parameters, no more positional arguments

Closes python-kasa#7

* Remove sync interface

* This requires python-kasa#13 to be merged. Closes python-kasa#12.
* Converts cli to use asyncio.run() where needed.
* The children from smartstrips is being initialized during the first update call.

* Convert on and off commands to use asyncio.run

* conftest: do the initial update automatically for the device, cleans up tests a bit

* return subdevices alias for strip plugs, remove sync from docstrings

* Make tests pass using pytest-asyncio

* Simplify tests and use pytest-asyncio.
* Removed the emeter tests for child devices, as this information do not seem to exist (based on the dummy sysinfo data). Can be added again if needed.
* Remove sync from docstrings.

* Fix incorrect type hint

* Add type hints and some docstrings to discovery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL