mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 03:33:35 +00:00
07af48e41a
* Discover refactoring, enhancements to the cli tool * Discover tries to detect the type of the device from sysinfo response * Discover.discover() returns an IP address keyed dictionary, values are initialized instances of the automatically detected device type. * When no IP is given, autodetect all supported devices and print out their states * When only IP but no type is given, autodetect type and make a call based on that information. * One can define --bulb or --plug to skip the detection. * renamed pyHS100.py -> smartdevice.py * SmartPlugException -> SmartDeviceException in comments * fix mic_type check * make time() return None on failure as we don't know which devices support getting the time and it's used in the cli tool * hw_info: check if key exists before accessing it, add mic_mac and mic_type * Check for mic_mac on mac, based on work by kdschloesser on issue #59 * make hound happy, __init__ on SmartDevice cannot error out so removing 'raises' documentation
22 lines
736 B
Python
22 lines
736 B
Python
"""
|
|
This module provides a way to interface with TP-Link's smart home devices,
|
|
such as smart plugs (HS1xx), wall switches (HS2xx), and light bulbs (LB1xx).
|
|
|
|
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` or `SmartPlug` must be used instead.
|
|
|
|
Module-specific errors are raised as `SmartDeviceException` and are expected
|
|
to be handled by the user of the library.
|
|
"""
|
|
# flake8: noqa
|
|
from .smartdevice import SmartDevice
|
|
from .smartplug import SmartPlug
|
|
from .types import SmartDeviceException
|
|
from .smartbulb import SmartBulb
|
|
from .protocol import TPLinkSmartHomeProtocol
|
|
from .discover import Discover
|