node-switchbot
    Preparing search index...

    Class WoAirPurifierTable

    Class representing a SwitchBot Air Purifier Table device.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get address(): string

      Returns string

    • get connectionState(): string

      Returns string

    • get id(): string

      Returns string

    • get onConnectHandler(): () => Promise<void>

      Returns () => Promise<void>

    • set onConnectHandler(func: () => Promise<void>): void

      Parameters

      • func: () => Promise<void>

      Returns void

    • get onDisconnectHandler(): () => Promise<void>

      Returns () => Promise<void>

    • set onDisconnectHandler(func: () => Promise<void>): void

      Parameters

      • func: () => Promise<void>

      Returns void

    Methods

    • Sends a command to the device and awaits a response.

      Parameters

      • reqBuf: Buffer

        The command buffer.

      Returns Promise<Buffer<ArrayBufferLike>>

      A Promise that resolves with the response buffer.

    • Logs a message with the specified log level.

      Parameters

      • level: string

        The severity level of the log (e.g., 'info', 'warn', 'error').

      • message: string

        The log message to be emitted.

      Returns Promise<void>

    • Operates the air purifier table with the given byte array.

      Parameters

      • bytes: number[]

        The byte array to send.

      Returns Promise<boolean>

      • Resolves with true if the operation was successful.
    • Sets the device name.

      Parameters

      • name: string

        The new device name.

      Returns Promise<void>

      A Promise that resolves when the name is set.

    • Sets the mode of the air purifier table.

      Parameters

      • mode: number

        The mode value (1-4).

      Returns Promise<boolean>

      • Resolves with true if the operation was successful.
    • Sets the speed of the air purifier table.

      Parameters

      • speed: number

        The speed value (0-100).

      Returns Promise<boolean>

      • Resolves with true if the operation was successful.
    • Turns the air purifier table off.

      Returns Promise<boolean>

      • Resolves with true if the air purifier table is turned off.
    • Turns the air purifier table on.

      Returns Promise<boolean>

      • Resolves with true if the air purifier table is turned on.
    • Parses service data for air purifier table devices.

      Parameters

      • serviceData: null | Buffer<ArrayBufferLike>

        The service data buffer.

      • manufacturerData: null | Buffer<ArrayBufferLike>

        The manufacturer data buffer.

      • OptionalemitLog: (level: string, message: string) => void

        The function to emit log messages.

      Returns null | airPurifierTableServiceData

      • The parsed service data or null.