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

71 lines (70 loc) 1.78 kB
import { TapoApiRequest, TapoApiResponse, TapoDeviceInfo } from '../types'; export interface DeviceUsage { time_usage?: { today?: number; past7?: number[]; past30?: number[]; }; } /** * Controller for basic device operations (on/off, info, usage) * Single responsibility: Basic device control and information */ export declare class DeviceController { private readonly sendRequest; constructor(sendRequest: (request: TapoApiRequest) => Promise<TapoApiResponse>); /** * Turn device on */ turnOn(): Promise<void>; /** * Turn device off */ turnOff(): Promise<void>; /** * Get device information */ getDeviceInfo(): Promise<TapoDeviceInfo>; /** * Get device usage information */ getDeviceUsage(): Promise<DeviceUsage>; /** * Set device alias/name */ setAlias(alias: string): Promise<void>; /** * Reset device to factory settings */ resetDevice(): Promise<void>; /** * Reboot device */ rebootDevice(): Promise<void>; /** * Check if device is online and responsive */ ping(): Promise<boolean>; /** * Get device status summary */ getStatusSummary(): Promise<{ isOnline: boolean; isOn: boolean; alias: string; model: string; rssi?: number; }>; /** * Set device location */ setLocation(latitude: number, longitude: number): Promise<void>; /** * Validate device model for specific features */ static validateDeviceModel(deviceModel: string, requiredFeatures: string[]): boolean; /** * Get supported features for a device model */ static getModelFeatures(deviceModel: string): string[]; }