mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +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:
@@ -270,10 +270,10 @@ class Discover:
|
||||
you can use *target* parameter to specify the network for discovery.
|
||||
|
||||
If given, `on_discovered` coroutine will get awaited with
|
||||
a :class:`SmartDevice`-derived object as parameter.
|
||||
a :class:`Device`-derived object as parameter.
|
||||
|
||||
The results of the discovery are returned as a dict of
|
||||
:class:`SmartDevice`-derived objects keyed with IP addresses.
|
||||
:class:`Device`-derived objects keyed with IP addresses.
|
||||
The devices are already initialized and all but emeter-related properties
|
||||
can be accessed directly.
|
||||
|
||||
@@ -332,7 +332,7 @@ class Discover:
|
||||
"""Discover a single device by the given IP address.
|
||||
|
||||
It is generally preferred to avoid :func:`discover_single()` and
|
||||
use :meth:`SmartDevice.connect()` instead as it should perform better when
|
||||
use :meth:`Device.connect()` instead as it should perform better when
|
||||
the WiFi network is congested or the device is not responding
|
||||
to discovery requests.
|
||||
|
||||
|
Reference in New Issue
Block a user