UNPKG

node-red-contrib-tplink-tapo-connect-api

Version:

This unofficial node-RED node allows connection to TP-Link Tapo devices. This project has been enhanced with AI support to enable new features. Starting with v0.50, we have added support for the KLAP protocol. To prioritize the operation of this node, we

49 lines (48 loc) 2.04 kB
import { BaseTapoDevice, TapoCredentials, TapoApiRequest, TapoApiResponse, PlugDeviceInfo, PlugUsageInfo, FeatureNotSupportedError, DeviceCapabilityError, Result, DeviceMethodOptions } from '../../types'; /** * P100 Smart Plug - Basic plug without energy monitoring */ export declare class P100Plug extends BaseTapoDevice { private unifiedProtocol; private featureCache; private deviceModel?; private requestQueue; constructor(ip: string, credentials: TapoCredentials); private checkDeviceConnectivity; connect(): Promise<void>; disconnect(): Promise<void>; /** * Check if device is currently authenticated */ isAuthenticated(): boolean; getDeviceInfo(): Promise<PlugDeviceInfo>; /** * Check if the device supports energy monitoring features * P100 does not support energy monitoring */ hasEnergyMonitoring(): Promise<boolean>; /** * Check if the device supports a specific feature */ supportsFeature(feature: string): Promise<boolean>; turnOn(): Promise<void>; turnOff(): Promise<void>; toggle(): Promise<void>; on(): Promise<void>; off(): Promise<void>; isOn(): Promise<boolean>; getUsageInfo(options?: DeviceMethodOptions): Promise<PlugUsageInfo>; /** * Get usage info using Result pattern for better error handling */ getUsageInfoResult(): Promise<Result<PlugUsageInfo, FeatureNotSupportedError | DeviceCapabilityError>>; getCurrentPower(options?: DeviceMethodOptions): Promise<number>; getTodayEnergy(options?: DeviceMethodOptions): Promise<number>; getMonthEnergy(options?: DeviceMethodOptions): Promise<number>; getTodayRuntime(options?: DeviceMethodOptions): Promise<number>; getMonthRuntime(options?: DeviceMethodOptions): Promise<number>; isOverheated(): Promise<boolean>; getOnTime(): Promise<number>; setDeviceInfo(params: Record<string, unknown>): Promise<void>; protected sendRequest<T>(request: TapoApiRequest): Promise<TapoApiResponse<T>>; }