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

60 lines (59 loc) 2.27 kB
import { BaseTapoDevice, TapoCredentials, TapoApiRequest, TapoApiResponse, PlugDeviceInfo, PlugUsageInfo, FeatureNotSupportedError, DeviceCapabilityError, Result, DeviceMethodOptions } from '../../types'; /** * P110 Smart Plug - Plug with energy monitoring capabilities */ export declare class P110Plug 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 * P110 supports 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>; /** * Get current power consumption in watts */ getCurrentPower(options?: DeviceMethodOptions): Promise<number>; /** * Get energy usage data */ getEnergyUsage(): Promise<any>; /** * Get energy data with detailed statistics */ getEnergyData(): Promise<any>; getUsageInfo(options?: DeviceMethodOptions): Promise<PlugUsageInfo>; /** * Get usage info using Result pattern for better error handling */ getUsageInfoResult(): Promise<Result<PlugUsageInfo, FeatureNotSupportedError | DeviceCapabilityError>>; 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>>; }