mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-11 18:08:02 +00:00
Remove SmartPlug in favor of SmartDevice (#781)
With the move towards autodetecting available features, there is no reason to keep SmartPlug around. kasa.smart.SmartPlug is removed in favor of kasa.smart.SmartDevice which offers the same functionality. Information about auto_off can be accessed using Features of the AutoOffModule on supported devices. Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
This commit is contained in:
@@ -14,7 +14,7 @@ from .protocol import (
|
||||
BaseProtocol,
|
||||
BaseTransport,
|
||||
)
|
||||
from .smart import SmartBulb, SmartPlug
|
||||
from .smart import SmartBulb, SmartDevice
|
||||
from .smartprotocol import SmartProtocol
|
||||
from .xortransport import XorTransport
|
||||
|
||||
@@ -135,10 +135,10 @@ def get_device_class_from_sys_info(info: Dict[str, Any]) -> Type[IotDevice]:
|
||||
def get_device_class_from_family(device_type: str) -> Optional[Type[Device]]:
|
||||
"""Return the device class from the type name."""
|
||||
supported_device_types: Dict[str, Type[Device]] = {
|
||||
"SMART.TAPOPLUG": SmartPlug,
|
||||
"SMART.TAPOPLUG": SmartDevice,
|
||||
"SMART.TAPOBULB": SmartBulb,
|
||||
"SMART.TAPOSWITCH": SmartBulb,
|
||||
"SMART.KASAPLUG": SmartPlug,
|
||||
"SMART.KASAPLUG": SmartDevice,
|
||||
"SMART.KASASWITCH": SmartBulb,
|
||||
"IOT.SMARTPLUGSWITCH": IotPlug,
|
||||
"IOT.SMARTBULB": IotBulb,
|
||||
|
Reference in New Issue
Block a user