node-switchbot
    Preparing search index...

    Class SwitchBotBLE

    SwitchBotBLE class to interact with SwitchBot devices.

    Hierarchy

    • EventEmitter
      • SwitchBotBLE
    Index

    Constructors

    Properties

    noble: any
    nobleInitialized: Promise<void>
    onadvertisement?: onadvertisement
    ondiscover?: ondiscover

    Methods

    • Starts scanning for SwitchBot devices.

      Parameters

      • Optionalparams: Params = {}

        Optional parameters.

      Returns Promise<void>

      • Resolves when scanning starts successfully.
    • Stops scanning for SwitchBot devices.

      Returns Promise<void>

      • Resolves when scanning stops successfully.
    • Validates the parameters.

      Parameters

      • params: Params

        The parameters to validate.

      • schema: Record<string, unknown>

        The schema to validate against.

      Returns Promise<void>

      • Resolves if parameters are valid, otherwise throws an error.
    • Waits for the specified time.

      Parameters

      • msec: number

        The time to wait in milliseconds.

      Returns Promise<void>

      • Resolves after the specified time.