node-switchbot
    Preparing search index...

    Class WoBlindTilt

    Class representing a WoBlindTilt 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

    • Closes the blind tilt to the nearest endpoint.

      Returns Promise<void>

    • Closes the blind tilt down to the nearest endpoint.

      Returns Promise<void>

    • Closes the blind tilt up to the nearest endpoint.

      Returns Promise<void>

    • 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.

    • Retrieves the basic information of the blind tilt.

      Returns Promise<null | object>

      • A promise that resolves to an object containing the basic information of the blind tilt.
    • Retrieves the current position of the blind tilt.

      Returns Promise<number>

      • The current position of the blind tilt (0-100).
    • 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>

    • Opens the blind tilt to the fully open position.

      Returns Promise<void>

    • Pauses the blind tilt operation.

      Returns Promise<void>

    • Runs the blind tilt to the specified position.

      Parameters

      • percent: number

        The target position percentage (0-100).

      • mode: number

        The running mode (0 or 1).

      Returns Promise<void>

    • Sets the device name.

      Parameters

      • name: string

        The new device name.

      Returns Promise<void>

      A Promise that resolves when the name is set.

    • Parses the service data and manufacturer data for the WoBlindTilt device.

      Parameters

      • serviceData: Buffer

        The service data buffer.

      • manufacturerData: Buffer

        The manufacturer data buffer.

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

        The function to emit log messages.

      • Optionalreverse: boolean = false

        Whether to reverse the tilt percentage.

      Returns Promise<null | blindTiltServiceData>

      • The parsed data object or null if the data is invalid.