mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-06 10:44:04 +00:00
Add tutorial doctest module and enable top level await (#919)
Add a tutorial module with examples that can be tested with `doctest`. In order to simplify the examples they can be run with doctest allowing top level await statements by adding a fixture to patch the builtins that xdoctest uses to test code. --------- Co-authored-by: Teemu R. <tpr@iki.fi>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
"""Python interface for TP-Link's smart home devices.
|
||||
|
||||
All common, shared functionalities are available through `SmartDevice` class::
|
||||
All common, shared functionalities are available through `Device` class::
|
||||
|
||||
x = SmartDevice("192.168.1.1")
|
||||
print(x.sys_info)
|
||||
>>> from kasa import Discover
|
||||
>>> x = await Discover.discover_single("192.168.1.1")
|
||||
>>> print(x.model)
|
||||
|
||||
For device type specific actions `SmartBulb`, `SmartPlug`, or `SmartStrip`
|
||||
should be used instead.
|
||||
For device type specific actions `modules` and `features` should be used instead.
|
||||
|
||||
Module-specific errors are raised as `KasaException` and are expected
|
||||
to be handled by the user of the library.
|
||||
|
Reference in New Issue
Block a user