/** * Dyson Link Device Class * * Concrete implementation for Dyson devices. * Supports fan control, heating, humidification across all models. */ import { DysonDevice } from './dysonDevice.js'; import type { DeviceFeatures, DeviceInfo } from './types.js'; import type { MqttClientFactory } from './dysonDevice.js'; import type { MqttConnectFn } from '../protocol/mqttClient.js'; /** * Dyson Link Device implementation * * Handles fan control for all Dyson purifier devices. * Features are determined by the device catalog based on product type. * * Commands are batched within a microtask to allow concurrent HomeKit * characteristic updates (e.g., Active + TargetState) to be merged * into a single MQTT command. */ export declare class DysonLinkDevice extends DysonDevice { /** Product type for this device */ readonly productType: string; /** Features supported by this device */ readonly supportedFeatures: DeviceFeatures; /** * Whether this device uses the dedicated `fpwr` power field instead of the * legacy `fmod` field. Derived from the device catalog (see PowerProtocol). */ private readonly usesFpwrProtocol; /** Pending command fields to be batched and sent */ private pendingCommandFields; /** Whether a command flush is scheduled */ private commandFlushScheduled; /** Whether a power-off is in progress (prevents concurrent commands from overriding OFF) */ private turningOff; /** * Create a new DysonLinkDevice * * @param deviceInfo - Device information from discovery * @param mqttClientFactory - Optional factory for creating MQTT client (for testing) * @param mqttConnectFn - Optional MQTT connect function (for testing) */ constructor(deviceInfo: DeviceInfo, mqttClientFactory?: MqttClientFactory, mqttConnectFn?: MqttConnectFn); /** * Queue command fields to be sent. Fields are merged and flushed * on the next microtask, allowing concurrent HomeKit updates to * produce a single MQTT command. */ private queueCommand; /** * Flush all pending command fields as a single MQTT command */ private flushCommand; /** * Set fan power on or off * * Uses the dedicated `fpwr` field (with `auto`/`fnsp`) for devices whose * catalog entry declares `powerProtocol: 'fpwr'`, otherwise the legacy * `fmod` field. See {@link getPowerProtocol}. * * @param on - True to turn on, false to turn off */ setFanPower(on: boolean): Promise; /** * Set fan speed * * @param speed - Fan speed (1-10) or -1 for auto mode */ setFanSpeed(speed: number): Promise; /** * Set oscillation on or off */ setOscillation(on: boolean): Promise; /** * Set night mode on or off */ setNightMode(on: boolean): Promise; /** * Set continuous monitoring on or off */ setContinuousMonitoring(on: boolean): Promise; /** * Set auto mode on or off */ setAutoMode(on: boolean): Promise; /** * Set jet focus (front airflow direction) on or off */ setJetFocus(on: boolean): Promise; /** * Set heating mode on or off (HP models only) */ setHeating(on: boolean): Promise; /** * Set heating mode on or off (HP-series only) * Alias for setHeating with feature check. */ setHeatingMode(on: boolean): Promise; /** * Set target temperature for heating (HP models only) * * @param celsius - Target temperature in Celsius (1-37) */ setTargetTemperature(celsius: number): Promise; /** * Set humidifier mode on or off (PH models only) */ setHumidifier(on: boolean): Promise; /** * Set humidifier to auto mode (PH models only) */ setHumidifierAuto(): Promise; /** * Set target humidity percentage (PH models only) * * @param percent - Target humidity (0-100) */ setTargetHumidity(percent: number): Promise; /** * Disconnect from the device, clearing any pending commands */ disconnect(): Promise; /** * Get the device features */ getFeatures(): DeviceFeatures; /** * Handle state message from device * * Parses the device-specific state from CURRENT-STATE and STATE-CHANGE messages. */ protected handleStateMessage(data: Record): void; } //# sourceMappingURL=dysonLinkDevice.d.ts.map