Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

UUIDS

UUIDS: { CHARACTERISTICS: { INDICATE: "72c90005-57a9-4d40-b746-534e22ec9f9e"; NOTIFY: "72c90003-57a9-4d40-b746-534e22ec9f9e"; WRITE: "72c90004-57a9-4d40-b746-534e22ec9f9e"; WRITE_WO_RESPONSE: "72c90002-57a9-4d40-b746-534e22ec9f9e" }; SERVICE_ID: "72c90001-57a9-4d40-b746-534e22ec9f9e" } = {SERVICE_ID: '72c90001-57a9-4d40-b746-534e22ec9f9e' as const,CHARACTERISTICS: {INDICATE: '72c90005-57a9-4d40-b746-534e22ec9f9e' as const,NOTIFY: '72c90003-57a9-4d40-b746-534e22ec9f9e' as const,WRITE: '72c90004-57a9-4d40-b746-534e22ec9f9e' as const,WRITE_WO_RESPONSE: '72c90002-57a9-4d40-b746-534e22ec9f9e' as const,} as const,} as const

Type declaration

  • CHARACTERISTICS: { INDICATE: "72c90005-57a9-4d40-b746-534e22ec9f9e"; NOTIFY: "72c90003-57a9-4d40-b746-534e22ec9f9e"; WRITE: "72c90004-57a9-4d40-b746-534e22ec9f9e"; WRITE_WO_RESPONSE: "72c90002-57a9-4d40-b746-534e22ec9f9e" }
    • INDICATE: "72c90005-57a9-4d40-b746-534e22ec9f9e"
    • NOTIFY: "72c90003-57a9-4d40-b746-534e22ec9f9e"
    • WRITE: "72c90004-57a9-4d40-b746-534e22ec9f9e"
    • WRITE_WO_RESPONSE: "72c90002-57a9-4d40-b746-534e22ec9f9e"
  • SERVICE_ID: "72c90001-57a9-4d40-b746-534e22ec9f9e"

onBatteryLevel

onBatteryLevel: ((battery: number) => void) | null = null

Battery level event

onSensorEvent

onSensorEvent: ((temperature: number, humidity: number, requestId: number) => void) | null = null

Sensing event

onStatusButtonPressed

onStatusButtonPressed: (() => void) | null = null

Status button pressed event

Static NotifyMode

NotifyMode: { ALWAYS: 32; EMIT_HUMIDITY: 2; EMIT_TEMPERATURE: 1; ONCE: 16; STOP: 0; UPDATE_HUMIDITY: 8; UPDATE_TEMPERATURE: 4 } = {STOP: 0 as const,EMIT_TEMPERATURE: 1 as const,EMIT_HUMIDITY: 2 as const,UPDATE_TEMPERATURE: 4 as const,UPDATE_HUMIDITY: 8 as const,ONCE: 16 as const,ALWAYS: 32 as const,} as const

Type declaration

  • ALWAYS: 32
  • EMIT_HUMIDITY: 2
  • EMIT_TEMPERATURE: 1
  • ONCE: 16
  • STOP: 0
  • UPDATE_HUMIDITY: 8
  • UPDATE_TEMPERATURE: 4

Accessors

battery

  • get battery(): number
  • Get battery level

    Returns number

featureCommand

  • get featureCommand(): number[]
  • Get command of feature behavior

    Returns number[]

Methods

checkVersion

  • checkVersion(): boolean
  • Check software version of MESH block

    Returns boolean

createSetmodeCommand

  • createSetmodeCommand(temperatureRangeUpper: number, temperatureRangeLower: number, humidityRangeUpper: number, humidityRangeLower: number, temperatureCondition: number, humidityCondition: number, notifyMode: number, opt_requestId?: number): number[]
  • Create command of set-mode

    Parameters

    • temperatureRangeUpper: number
    • temperatureRangeLower: number
    • humidityRangeUpper: number
    • humidityRangeLower: number
    • temperatureCondition: number
    • humidityCondition: number
    • notifyMode: number
    • Default value opt_requestId: number = 0

    Returns number[]

createStatusbarLedCommand

  • createStatusbarLedCommand(power: boolean, red: boolean, green: boolean, blue: boolean): number[]
  • Create command of statusbar LED

    Parameters

    • power: boolean
    • red: boolean
    • green: boolean
    • blue: boolean

    Returns number[]

    command

indicate

  • indicate(data: number[]): void
  • Set result of indicate

    Parameters

    • data: number[]

    Returns void

    void

notify

  • notify(data: number[]): void
  • Parse data that received from MESH block, and emit event

    Parameters

    • data: number[]

    Returns void

    void

Static isMESHblock

  • isMESHblock(name: string | null, opt_serialnumber?: string): boolean
  • Verify that the device is MESH block

    Parameters

    • name: string | null
    • Default value opt_serialnumber: string = ""

    Returns boolean

Object literals

Static EmitCondition

EmitCondition: object

ABOVE_UPPER_OR_ABOVE_LOWER

ABOVE_UPPER_OR_ABOVE_LOWER: 1 = 1 as const

ABOVE_UPPER_OR_BELOW_LOWER

ABOVE_UPPER_OR_BELOW_LOWER: 0 = 0 as const

BELOW_UPPER_OR_ABOVE_LOWER

BELOW_UPPER_OR_ABOVE_LOWER: 17 = 17 as const

BELOW_UPPER_OR_BELOW_LOWER

BELOW_UPPER_OR_BELOW_LOWER: 16 = 16 as const

Generated using TypeDoc