/** * Passive polling interval (24 hours) */ import type { Buffer } from 'node:buffer'; export declare const PASSIVE_POLL_INTERVAL: number; /** * OpenAPI Configuration */ export declare const DEFAULT_BASE_URL = "https://api.switch-bot.com"; export declare const API_VERSION = "v1.1"; export declare const urls: { base: string; devices: string; scenes: string; webhook: string; }; /** * Update the base URL for all API endpoints * @param newBaseURL - The new base URL to use */ export declare function updateBaseURL(newBaseURL: string): void; /** * BLE Configuration */ export declare const BLE_SERVICE_UUID = "cba20d00224d11e69fb80002a5d5c51b"; export declare const BLE_WRITE_CHARACTERISTIC_UUID = "cba20002224d11e69fb80002a5d5c51b"; export declare const BLE_NOTIFY_CHARACTERISTIC_UUID = "cba20003224d11e69fb80002a5d5c51b"; export declare const SERV_UUID_PRIMARY = "cba20d00-224d-11e6-9fb8-0002a5d5c51b"; export declare const CHAR_UUID_WRITE = "cba20002-224d-11e6-9fb8-0002a5d5c51b"; export declare const CHAR_UUID_NOTIFY = "cba20003-224d-11e6-9fb8-0002a5d5c51b"; export declare const CHAR_UUID_DEVICE = "cba20d00-224d-11e6-9fb8-0002a5d5c51b"; /** * BLE Timeouts (in milliseconds) */ export declare const BLE_SCAN_TIMEOUT = 10000; export declare const BLE_CONNECT_TIMEOUT = 10000; export declare const BLE_COMMAND_TIMEOUT = 5000; export declare const READ_TIMEOUT_MSEC = 10000; export declare const WRITE_TIMEOUT_MSEC = 10000; /** * Device Command Constants */ export declare const DEVICE_COMMANDS: { readonly BOT: { readonly PRESS: readonly [87, 1, 0]; readonly TURN_ON: readonly [87, 1, 1]; readonly TURN_OFF: readonly [87, 1, 2]; readonly DOWN: readonly [87, 1, 1]; readonly UP: readonly [87, 1, 2]; readonly SET_MODE: readonly [87, 15, 71, 1]; readonly SET_LONG_PRESS: readonly [87, 15, 71, 3]; }; readonly CURTAIN: { readonly OPEN: readonly [87, 15, 69, 1, 5, 255, 0]; readonly CLOSE: readonly [87, 15, 69, 1, 5, 255, 100]; readonly PAUSE: readonly [87, 15, 69, 1, 0, 255]; readonly POSITION: readonly [87, 15, 69, 1, 5]; readonly EXTENDED_INFO: readonly [87, 15, 70, 1]; }; readonly ROLLER_SHADE: { readonly PAUSE: readonly [87, 15, 71, 1, 0, 0, 1]; readonly POSITION: readonly [87, 15, 71, 1, 1, 0, 1]; readonly POSITION_WITH_MODE: readonly [87, 15, 71, 1, 5, 0]; }; readonly BLIND_TILT: { readonly OPEN: readonly [87, 15, 69, 1, 5, 255, 50]; readonly CLOSE_UP: readonly [87, 15, 69, 1, 5, 255, 100]; readonly CLOSE_DOWN: readonly [87, 15, 69, 1, 5, 255, 0]; readonly PAUSE: readonly [87, 15, 69, 1, 0, 255]; }; readonly BULB: { readonly BASE: readonly [87, 15, 71, 1]; readonly READ_STATE: readonly [87, 15, 72, 1]; readonly TURN_ON: readonly [1, 1]; readonly TURN_OFF: readonly [1, 2]; readonly SET_BRIGHTNESS: readonly [2, 20]; readonly SET_COLOR_TEMP: readonly [2, 23]; readonly SET_RGB: readonly [2, 18]; readonly SET_EFFECT: readonly [3]; }; readonly HUMIDIFIER: { readonly HEADER: "5701"; readonly TURN_ON: "570101"; readonly TURN_OFF: "570102"; readonly INCREASE: "570103"; readonly DECREASE: "570104"; readonly SET_AUTO_MODE: "570105"; readonly SET_MANUAL_MODE: "570106"; }; readonly AIR_PURIFIER: { readonly TURN_ON: readonly [87, 1, 1]; readonly TURN_OFF: readonly [87, 1, 2]; readonly SET_MODE: readonly [87, 2]; readonly SET_SPEED: readonly [87, 3]; readonly RESET_FILTER_USAGE: readonly [87, 15, 76, 9]; readonly READ_FILTER_USAGE: readonly [87, 15, 77, 9]; }; readonly VACUUM: { readonly CLEAN_UP: { readonly 1: readonly [87, 15, 90, 0, 255, 255, 112, 1]; readonly 2: readonly [90, 64, 1, 1, 1, 1, 38]; }; readonly RETURN_TO_DOCK: { readonly 1: readonly [87, 15, 90, 0, 255, 255, 112, 2]; readonly 2: readonly [90, 64, 1, 1, 1, 2, 37]; }; }; readonly PLUG: { readonly TURN_ON: readonly [87, 15, 80, 1, 1]; readonly TURN_OFF: readonly [87, 15, 80, 1, 2]; readonly TOGGLE: readonly [87, 15, 80, 1, 0]; }; readonly RELAY: { readonly GET_BASIC_INFO: readonly [87, 2]; readonly CHANNEL1_ON: readonly [87, 15, 80, 1, 1]; readonly CHANNEL1_OFF: readonly [87, 15, 80, 1, 2]; readonly CHANNEL2_ON: readonly [87, 15, 80, 2, 1]; readonly CHANNEL2_OFF: readonly [87, 15, 80, 2, 2]; }; readonly COMMON: { readonly POWER_ON: readonly [87, 1, 1]; readonly POWER_OFF: readonly [87, 1, 2]; }; }; /** * @deprecated These bytes never matched the lock protocol. Locks use {@link LOCK_COMMANDS}. */ export declare const WoSmartLockCommands: { readonly LOCK: readonly [87, 15, 78, 1, 0]; readonly UNLOCK: readonly [87, 15, 78, 1, 1]; }; /** * @deprecated These bytes never matched the lock protocol. Locks use {@link LOCK_COMMANDS}. */ export declare const WoSmartLockProCommands: { readonly LOCK: readonly [87, 15, 79, 1, 0]; readonly UNLOCK: readonly [87, 15, 79, 1, 1]; readonly UNLATCH: readonly [87, 15, 79, 1, 2]; }; /** Lock models, with pySwitchbot's names */ export type LockModel = 'Lock' | 'Lock Lite' | 'Lock Pro' | 'Lock Pro WiFi' | 'Lock Ultra' | 'Lock Ultra Max' | 'UWB Lock' | 'Lock Nano' | 'Lock Vision' | 'Lock Vision Pro'; /** BLE commands for one lock model, before encryption */ export interface LockCommandSet { lock: readonly number[]; unlock: readonly number[]; unlockWithoutUnlatch: readonly number[]; /** Read the lock info */ info: readonly number[]; enableNotifications: readonly number[]; /** Lock Ultra only */ halfLock?: readonly number[]; /** Read the level of each battery bay; Lock Pro only */ batteryBays?: readonly number[]; } /** * BLE lock commands for each lock model, as pySwitchbot's tables in switchbot/devices/lock.py. * Locks are encrypted devices: set the key with `device.setKey({ keyId, encryptionKey })`. */ export declare const LOCK_COMMANDS: Record; /** Lock Ultra Quick Key: read the settings */ export declare const LOCK_QUICK_KEY_GET: readonly number[]; /** Lock Ultra Quick Key: write prefix, followed by the update, value and motor speed bytes */ export declare const LOCK_QUICK_KEY_SET_PREFIX: readonly number[]; /** * Lock models for the device type names node-switchbot and the OpenAPI use. Device types that * are not listed fall back to the lock class's own model. */ export declare const LOCK_MODEL_BY_DEVICE_TYPE: Record; /** * Devices identified by the 4-byte product ID at the end of their service data, as pySwitchbot's * multi-byte SUPPORTED_TYPES keys (found by `_find_model_from_service_data_suffix`). Keys are hex; * each product has a `00` and a `01` form. * * Only products whose BLE status and commands node-switchbot implements are listed: recognising a * product over BLE makes its status BLE-first. */ export declare const PRODUCT_ID_MODEL_MAP: Record; /** * The product ID from the end of a service data payload, as pySwitchbot checks it: the last 4 * bytes, then the 4 bytes before the last. */ export declare function findProductId(data: Buffer): string | undefined; /** * Device Model to Type Mapping */ export declare const DEVICE_MODEL_MAP: Record; /** * Device Type to Class Name Mapping */ export declare const DEVICE_CLASS_MAP: Record; /** * Normalise a device type string so the same model resolves regardless of * which discovery path reported it. * * `DEVICE_CLASS_MAP` is keyed by the BLE display names, for example * `'Meter Pro (CO2)'`. The OpenAPI `deviceType` field uses compact spellings * for the same models, for example `'MeterPro(CO2)'`. Lowercasing and removing * spaces, underscores and hyphens maps both spellings onto one key. */ export declare function normalizeDeviceTypeKey(deviceType: string): string; /** * Resolve the device class name for a BLE display name or an OpenAPI * `deviceType`. An exact match wins; otherwise the normalised form is used. * Returns `undefined` for models that are genuinely unsupported. */ export declare function resolveDeviceClassName(deviceType: string): string | undefined; /** * Default configuration values */ export declare const DEFAULTS: { readonly logLevel: 2; readonly scanTimeout: 10000; readonly connectTimeout: 10000; readonly commandTimeout: 5000; readonly enableBLE: true; readonly enableFallback: true; readonly baseURL: "https://api.switch-bot.com"; readonly enableConnectionIntelligence: true; readonly enableCircuitBreaker: true; readonly enableRetry: true; readonly maxRetryAttempts: 3; readonly retryInitialDelayMs: 100; readonly retryMaxDelayMs: 5000; }; /** * Platform detection */ export declare const IS_LINUX: boolean; export declare const IS_MACOS: boolean; export declare const BLE_SUPPORTED: boolean; //# sourceMappingURL=settings.d.ts.map