Get child emeters with CLI (#623)

* Get child emeters with CLI

* Avoid extra IO when not que querying the child emeter
This commit is contained in:
Nathan Wreggit
2024-01-04 17:25:24 -08:00
committed by GitHub
parent 2d8a8d9511
commit cfe694e5de
3 changed files with 40 additions and 4 deletions

View File

@@ -128,7 +128,7 @@ def get_device_class_from_sys_info(info: Dict[str, Any]) -> Type[SmartDevice]:
def get_device_class_from_family(device_type: str) -> Optional[Type[SmartDevice]]:
"""Return the device class from the type name."""
supported_device_types: dict[str, Type[SmartDevice]] = {
supported_device_types: Dict[str, Type[SmartDevice]] = {
"SMART.TAPOPLUG": TapoPlug,
"SMART.TAPOBULB": TapoBulb,
"SMART.KASAPLUG": TapoPlug,
@@ -147,7 +147,7 @@ def get_protocol(
protocol_transport_key = (
protocol_name + "." + config.connection_type.encryption_type.value
)
supported_device_protocols: dict[
supported_device_protocols: Dict[
str, Tuple[Type[TPLinkProtocol], Type[BaseTransport]]
] = {
"IOT.XOR": (TPLinkSmartHomeProtocol, _XorTransport),