mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-04 01:34:12 +00:00
Add DeviceConfig to allow specifying configuration parameters (#569)
* Add DeviceConfig handling * Update post review * Further update post latest review * Update following latest review * Update docstrings and docs
This commit is contained in:
@@ -23,9 +23,12 @@ This will return you a list of device instances based on the discovery replies.
|
||||
If the device's host is already known, you can use to construct a device instance with
|
||||
:meth:`~kasa.SmartDevice.connect()`.
|
||||
|
||||
When connecting a device with the :meth:`~kasa.SmartDevice.connect()` method, it is recommended to
|
||||
pass the device type as well as this allows the library to use the correct device class for the
|
||||
device without having to query the device.
|
||||
The :meth:`~kasa.SmartDevice.connect()` also enables support for connecting to new
|
||||
KASA SMART protocol and TAPO devices directly using the parameter :class:`~kasa.DeviceConfig`.
|
||||
Simply serialize the :attr:`~kasa.SmartDevice.config` property via :meth:`~kasa.DeviceConfig.to_dict()`
|
||||
and then deserialize it later with :func:`~kasa.DeviceConfig.from_dict()`
|
||||
and then pass it into :meth:`~kasa.SmartDevice.connect()`.
|
||||
|
||||
|
||||
.. _update_cycle:
|
||||
|
||||
|
18
docs/source/deviceconfig.rst
Normal file
18
docs/source/deviceconfig.rst
Normal file
@@ -0,0 +1,18 @@
|
||||
DeviceConfig
|
||||
============
|
||||
|
||||
.. contents:: Contents
|
||||
:local:
|
||||
|
||||
.. note::
|
||||
|
||||
Feel free to open a pull request to improve the documentation!
|
||||
|
||||
|
||||
API documentation
|
||||
*****************
|
||||
|
||||
.. autoclass:: kasa.DeviceConfig
|
||||
:members:
|
||||
:inherited-members:
|
||||
:undoc-members:
|
@@ -15,3 +15,4 @@
|
||||
smartdimmer
|
||||
smartstrip
|
||||
smartlightstrip
|
||||
deviceconfig
|
||||
|
Reference in New Issue
Block a user