node-switchbot
    Preparing search index...

    Interface SwitchBotConfig

    SwitchBot configuration options

    interface SwitchBotConfig {
        _internal?: { forceAPI?: boolean; forceBLE?: boolean };
        baseURL?: string;
        detailedErrors?: boolean;
        enableBLE?: boolean;
        enableCircuitBreaker?: boolean;
        enableConnectionIntelligence?: boolean;
        enableFallback?: boolean;
        enableRetry?: boolean;
        logger?: {
            debug: (message: string, ...args: any[]) => void;
            error: (message: string, ...args: any[]) => void;
            info: (message: string, ...args: any[]) => void;
            warn: (message: string, ...args: any[]) => void;
        };
        logLevel?: LogLevel;
        maxRetryAttempts?: number;
        noble?: any;
        retryInitialDelayMs?: number;
        retryMaxDelayMs?: number;
        scanTimeout?: number;
        secret?: string;
        token?: string;
        [key: string]: any;
    }

    Indexable

    • [key: string]: any

      Additional custom options can be added as needed

    Index

    Properties

    _internal?: { forceAPI?: boolean; forceBLE?: boolean }

    Internal options for testing and advanced use (not part of public API)

    Type Declaration

    • OptionalforceAPI?: boolean

      Force use of API for testing (overrides intelligent selection)

    • OptionalforceBLE?: boolean

      Force use of BLE for testing (overrides intelligent selection)

    baseURL?: string

    OpenAPI base URL (optional - defaults to official API)

    detailedErrors?: boolean

    Enable detailed error reporting in command results (default: false)

    enableBLE?: boolean

    Enable BLE scanning (default: true on Linux)

    enableCircuitBreaker?: boolean

    Enable circuit breaker for connection reliability (default: true)

    enableConnectionIntelligence?: boolean

    Enable intelligent connection selection based on success history (default: true)

    enableFallback?: boolean

    Enable BLE to API fallback on errors (default: true)

    enableRetry?: boolean

    Enable automatic retry with exponential backoff (default: true)

    logger?: {
        debug: (message: string, ...args: any[]) => void;
        error: (message: string, ...args: any[]) => void;
        info: (message: string, ...args: any[]) => void;
        warn: (message: string, ...args: any[]) => void;
    }

    Custom logger instance (optional)

    logLevel?: LogLevel

    Log level (default: WARN)

    maxRetryAttempts?: number

    Maximum retry attempts per command (default: 3)

    noble?: any

    Noble instance (optional - for custom BLE configuration)

    retryInitialDelayMs?: number

    Initial retry delay in milliseconds (default: 100)

    retryMaxDelayMs?: number

    Maximum retry delay in milliseconds (default: 5000)

    scanTimeout?: number

    BLE scan timeout in milliseconds (default: 10000)

    secret?: string

    OpenAPI secret (optional - required for API/Hybrid mode)

    token?: string

    OpenAPI token (optional - required for API/Hybrid mode)