mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 03:33:35 +00:00
7bb4a456a2
* Add plumbing for passing credentials as far as discovery * Pass credentials to Smart devices * Rename authentication exception * Fix tests failure due to test_json_output leaving echo as nop * Fix test_credentials test * Do not print credentials, fix echo function bug and improve get type parameter * Add device class constructor test * Add comment for echo handling and move assignment
54 lines
1.4 KiB
Python
Executable File
54 lines
1.4 KiB
Python
Executable File
"""Python interface for TP-Link's smart home devices.
|
|
|
|
All common, shared functionalities are available through `SmartDevice` class::
|
|
|
|
x = SmartDevice("192.168.1.1")
|
|
print(x.sys_info)
|
|
|
|
For device type specific actions `SmartBulb`, `SmartPlug`, or `SmartStrip`
|
|
should be used instead.
|
|
|
|
Module-specific errors are raised as `SmartDeviceException` and are expected
|
|
to be handled by the user of the library.
|
|
"""
|
|
from importlib.metadata import version
|
|
|
|
from kasa.credentials import Credentials
|
|
from kasa.discover import Discover
|
|
from kasa.emeterstatus import EmeterStatus
|
|
from kasa.exceptions import (
|
|
AuthenticationException,
|
|
SmartDeviceException,
|
|
UnsupportedDeviceException,
|
|
)
|
|
from kasa.protocol import TPLinkSmartHomeProtocol
|
|
from kasa.smartbulb import SmartBulb, SmartBulbPreset, TurnOnBehavior, TurnOnBehaviors
|
|
from kasa.smartdevice import DeviceType, SmartDevice
|
|
from kasa.smartdimmer import SmartDimmer
|
|
from kasa.smartlightstrip import SmartLightStrip
|
|
from kasa.smartplug import SmartPlug
|
|
from kasa.smartstrip import SmartStrip
|
|
|
|
__version__ = version("python-kasa")
|
|
|
|
|
|
__all__ = [
|
|
"Discover",
|
|
"TPLinkSmartHomeProtocol",
|
|
"SmartBulb",
|
|
"SmartBulbPreset",
|
|
"TurnOnBehaviors",
|
|
"TurnOnBehavior",
|
|
"DeviceType",
|
|
"EmeterStatus",
|
|
"SmartDevice",
|
|
"SmartDeviceException",
|
|
"SmartPlug",
|
|
"SmartStrip",
|
|
"SmartDimmer",
|
|
"SmartLightStrip",
|
|
"AuthenticationException",
|
|
"UnsupportedDeviceException",
|
|
"Credentials",
|
|
]
|