node-switchbot
    Preparing search index...

    Class DeviceOverrideStateDuringConnectionAbstract

    Base class for devices that should ignore advertisement state while connected. Prevents stale BLE advertisement data from overriding active connection state.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get deviceType(): string

      Get device type (property accessor for convenience)

      Returns string

    • get id(): string | undefined

      Get device ID (property accessor for convenience)

      Returns string | undefined

    • get mac(): string | undefined

      Get MAC address (property accessor for convenience)

      Returns string | undefined

    • get name(): string

      Get device name (property accessor for convenience)

      Returns string

    Methods

    • Get basic device info (universal settings retrieval) Returns: battery, firmware, device-specific settings, etc. Command: 0x57 0x02 (BLE), 'getBasicInfo' (API)

      Example usage: const info = await device.getBasicInfo(); console.log(info);

      Returns a CommandResult object with device info fields.

      Returns Promise<CommandResult>

    • Returns true if device should be polled (passive polling interval elapsed)

      Parameters

      • interval: number = PASSIVE_POLL_INTERVAL

      Returns boolean

    • Register a custom fallback handler

      Parameters

      • handler: FallbackHandler
      • Optionaloptions: FallbackHandlerOptions

      Returns string

    • Send multiple commands in sequence (all must succeed) Used for Curtain 3, bulbs, strips, and other multi-step devices

      Parameters

      • commands: (() => Promise<boolean>)[]

      Returns Promise<boolean>

    • Send multiple commands (returns true if any succeed) Used for fallback operations with complex patterns

      Parameters

      • commands: (() => Promise<boolean>)[]

      Returns Promise<boolean>

    • Universal mode setting command BLE: 0x57 0x03 [modeByte] API: 'setMode' (if available)

      Parameters

      • mode: string | number

        Mode value (number or string, per-device enum recommended)

        Example usage: await device.setMode('auto') await device.setMode(1)

        Returns a CommandResult object indicating success and mode info.

      Returns Promise<CommandResult>