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

66 lines (65 loc) 1.89 kB
import { TapoCredentials } from '../types'; import { BaseDevice } from './base-device'; import { ProtocolType } from '../core/protocol-selector'; import { LightEffect } from '../controllers/lighting-controller'; /** * Bulb device implementation using composition pattern * Single responsibility: Bulb-specific device behavior */ export declare class BulbDevice extends BaseDevice { private auth?; private klapAuth?; constructor(ip: string, credentials: TapoCredentials, deviceModel: string); /** * Initialize session based on selected protocol */ protected initializeSession(protocol: ProtocolType): Promise<void>; /** * Initialize KLAP session */ private initializeKlapSession; /** * Initialize Passthrough session */ private initializePassthroughSession; /** * Set light effect (if supported) */ setLightEffect(effect: LightEffect): Promise<void>; /** * Get predefined light effects */ getPredefinedEffects(): LightEffect[]; /** * Turn off light effect */ turnOffLightEffect(): Promise<void>; /** * Get bulb-specific status */ getBulbStatus(): Promise<{ isOn: boolean; brightness?: number; colorMode?: 'white' | 'color'; hue?: number; saturation?: number; colorTemp?: number; hasEffectActive?: boolean; }>; /** * Determine current color mode */ private determineColorMode; /** * Check if there's an active light effect */ private hasActiveEffect; /** * Set bulb to white mode with specific temperature */ setWhiteMode(temperature?: number, brightness?: number): Promise<void>; /** * Set bulb to color mode with specific color */ setColorMode(hue: number, saturation?: number, brightness?: number): Promise<void>; }