Export modules & make sphinx happy (#334)

This commit is contained in:
Teemu R 2022-04-06 01:41:08 +02:00 committed by GitHub
parent d848117384
commit a39cef9a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 10 deletions

View File

@ -45,6 +45,7 @@ API documentation for modules
***************************** *****************************
.. automodule:: kasa.modules .. automodule:: kasa.modules
:noindex:
:members: :members:
:inherited-members: :inherited-members:
:undoc-members: :undoc-members:

View File

@ -1,4 +1,4 @@
# flake8: noqa """Module for individual feature modules."""
from .ambientlight import AmbientLight from .ambientlight import AmbientLight
from .antitheft import Antitheft from .antitheft import Antitheft
from .cloud import Cloud from .cloud import Cloud
@ -10,3 +10,18 @@ from .rulemodule import Rule, RuleModule
from .schedule import Schedule from .schedule import Schedule
from .time import Time from .time import Time
from .usage import Usage from .usage import Usage
__all__ = [
"AmbientLight",
"Antitheft",
"Cloud",
"Countdown",
"Emeter",
"Module",
"Motion",
"Rule",
"RuleModule",
"Schedule",
"Time",
"Usage",
]

View File

@ -42,7 +42,7 @@ _LOGGER = logging.getLogger(__name__)
class SmartBulb(SmartDevice): class SmartBulb(SmartDevice):
"""Representation of a TP-Link Smart Bulb. r"""Representation of a TP-Link Smart Bulb.
To initialize, you have to await :func:`update()` at least once. To initialize, you have to await :func:`update()` at least once.
This will allow accessing the properties using the exposed properties. This will allow accessing the properties using the exposed properties.
@ -50,7 +50,7 @@ class SmartBulb(SmartDevice):
All changes to the device are done using awaitable methods, All changes to the device are done using awaitable methods,
which will not change the cached values, but you must await :func:`update()` separately. which will not change the cached values, but you must await :func:`update()` separately.
Errors reported by the device are raised as :class:`SmartDeviceException`s, Errors reported by the device are raised as :class:`SmartDeviceException`\s,
and should be handled by the user of the library. and should be handled by the user of the library.
Examples: Examples:
@ -68,7 +68,7 @@ class SmartBulb(SmartDevice):
>>> print(bulb.is_on) >>> print(bulb.is_on)
True True
You can use the is_-prefixed properties to check for supported features You can use the ``is_``-prefixed properties to check for supported features
>>> bulb.is_dimmable >>> bulb.is_dimmable
True True
>>> bulb.is_color >>> bulb.is_color

View File

@ -7,7 +7,7 @@ from kasa.smartplug import SmartPlug
class SmartDimmer(SmartPlug): class SmartDimmer(SmartPlug):
"""Representation of a TP-Link Smart Dimmer. r"""Representation of a TP-Link Smart Dimmer.
Dimmers work similarly to plugs, but provide also support for Dimmers work similarly to plugs, but provide also support for
adjusting the brightness. This class extends :class:`SmartPlug` interface. adjusting the brightness. This class extends :class:`SmartPlug` interface.
@ -18,7 +18,7 @@ class SmartDimmer(SmartPlug):
All changes to the device are done using awaitable methods, All changes to the device are done using awaitable methods,
which will not change the cached values, but you must await :func:`update()` separately. which will not change the cached values, but you must await :func:`update()` separately.
Errors reported by the device are raised as :class:`SmartDeviceException`s, Errors reported by the device are raised as :class:`SmartDeviceException`\s,
and should be handled by the user of the library. and should be handled by the user of the library.
Examples: Examples:

View File

@ -9,7 +9,7 @@ _LOGGER = logging.getLogger(__name__)
class SmartPlug(SmartDevice): class SmartPlug(SmartDevice):
"""Representation of a TP-Link Smart Switch. r"""Representation of a TP-Link Smart Switch.
To initialize, you have to await :func:`update()` at least once. To initialize, you have to await :func:`update()` at least once.
This will allow accessing the properties using the exposed properties. This will allow accessing the properties using the exposed properties.
@ -17,7 +17,7 @@ class SmartPlug(SmartDevice):
All changes to the device are done using awaitable methods, All changes to the device are done using awaitable methods,
which will not change the cached values, but you must await :func:`update()` separately. which will not change the cached values, but you must await :func:`update()` separately.
Errors reported by the device are raised as :class:`SmartDeviceException`s, Errors reported by the device are raised as :class:`SmartDeviceException`\s,
and should be handled by the user of the library. and should be handled by the user of the library.
Examples: Examples:

View File

@ -29,7 +29,7 @@ def merge_sums(dicts):
class SmartStrip(SmartDevice): class SmartStrip(SmartDevice):
"""Representation of a TP-Link Smart Power Strip. r"""Representation of a TP-Link Smart Power Strip.
A strip consists of the parent device and its children. A strip consists of the parent device and its children.
All methods of the parent act on all children, while the child devices All methods of the parent act on all children, while the child devices
@ -41,7 +41,7 @@ class SmartStrip(SmartDevice):
All changes to the device are done using awaitable methods, All changes to the device are done using awaitable methods,
which will not change the cached values, but you must await :func:`update()` separately. which will not change the cached values, but you must await :func:`update()` separately.
Errors reported by the device are raised as :class:`SmartDeviceException`s, Errors reported by the device are raised as :class:`SmartDeviceException`\s,
and should be handled by the user of the library. and should be handled by the user of the library.
Examples: Examples: