Options
All
  • Public
  • Public/Protected
  • All
Menu

Switchbot_Bot management class Switchbot_Botを管理するクラス

Hierarchy

Implements

Index

Constructors

constructor

Properties

_peripheral

_peripheral: BleRemotePeripheral

Optional ondisconnect

ondisconnect: undefined | ((reason: any) => void)

Optional params

Methods

connectWait

  • connectWait(setting?: Pick<BleConnectSetting, "retry" | "forceConnect">): Promise<void>
  • Parameters

    Returns Promise<void>

downWait

  • downWait(): Promise<number[]>
  • Returns Promise<number[]>

getDeviceInfoWait

  • getDeviceInfoWait(): Promise<void>
  • Returns Promise<void>

pressWait

  • pressWait(): Promise<number[]>
  • Returns Promise<number[]>

turnOffWait

  • turnOffWait(): Promise<number[]>
  • Returns Promise<number[]>

turnOnWait

  • turnOnWait(): Promise<number[]>
  • Returns Promise<number[]>

upWait

  • upWait(): Promise<number[]>
  • Returns Promise<number[]>

wired

  • wired(obniz: Obniz): void
  • Parameters

    Returns void

Static getData

  • Get a data from the Switchbot_Bot

    Switchbot_Botらデータを取得

    Parameters

    • peripheral: BleRemotePeripheral

      instance of BleRemotePeripheral BleRemotePeripheralのインスタンス

    Returns Switchbot_Bot_Data | null

    received data from the Switchbot_Bot Switchbot_Botから受け取ったデータ

Static getServiceDataPayload

  • getServiceDataPayload(peripheral: BleRemotePeripheral, deviceType: number | number[], serviceDataPayloadLength: number): null | number[]

Static info

Static isDevice

  • Verify that the received peripheral is from the Switchbot_Bot

    受け取ったPeripheralがSwitchbot_Botのものかどうかを確認する

    Parameters

    • peripheral: BleRemotePeripheral

      instance of BleRemotePeripheral BleRemotePeripheralのインスタンス

    Returns boolean

    Whether it is the Switchbot_Bot

    Switchbot_Botかどうか

Static isSwitchbotDevice

  • isSwitchbotDevice(peripheral: BleRemotePeripheral, deviceType: number | number[], serviceDataPayloadLength: number): boolean

Generated using TypeDoc