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

Remove sync interface, add asyncio discovery by rytilahti · Pull Request #14 · python-kasa/python-kasa · GitHub

Repository navigation

Remove sync interface, add asyncio discovery - #14

Merged
rytilahti merged 9 commits into
python-kasa:masterfrom
rytilahti:remove_sync_interface
Jan 12, 2020
Merged

rytilahti merged 9 commits into
python-kasa:masterfrom
rytilahti:remove_sync_interface

Conversation

rytilahti commented Jan 12, 2020 •
edited
Loading

Copy link
Copy Markdown
Member

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

Closes python-kasa#7
* 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.
* 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.
rytilahti requested a review from basnijholt January 12, 2020 21:10

Copy link
Copy Markdown
Member Author

This PR makes the tests pass again (some parts of the strip support was not implemented completely, and some users, e.g., homeassistant simply went and hacked around the internals to make it work), some details in the commit messages 🎉

Comment thread kasa/discover.py Outdated

Copy link
Copy Markdown
Contributor

Great work!

I didn't know about pytest.mark.asyncio. Nice work!

Unfortunately, I don't have the devices to test it (except an HS110).

Other than that one comment, LGTM.

Copy link
Copy Markdown
Member Author

Same applies to me (i.e., only HS110 here, too :-) I'm hoping to pick up some testers soon enough, I'm still porting homeassistant integration at the moment.

rytilahti changed the title Remove sync interface Remove sync interface, add asyncio discovery Jan 12, 2020
rytilahti merged commit 524d28a into python-kasa:master Jan 12, 2020
rytilahti deleted the remove_sync_interface branch January 12, 2020 21:44
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.

Remove sync interface wrapper

2 participants


Back | FazBrowse Home | New Git URL