Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ObnizApi

Hierarchy

  • ObnizApi

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Parameters

    Returns ObnizApi

Properties

options

options: any

urlBase

urlBase: any

Accessors

apiVersion

  • get apiVersion(): string
  • obniz.js major version string

    Returns string

Methods

getState

  • getState(callback: (val: { state: "online" | "offline" }) => void): Promise<any>
  • Get device is online or offline

    Parameters

    • callback: (val: { state: "online" | "offline" }) => void

      with result

        • (val: { state: "online" | "offline" }): void
        • Parameters

          • val: { state: "online" | "offline" }
            • state: "online" | "offline"

          Returns void

    Returns Promise<any>

getStateWait

  • getStateWait(): Promise<{ state: "online" | "offline" }>
  • Get device is online or offline

    Returns Promise<{ state: "online" | "offline" }>

postJsonWait

  • postJsonWait(json: any, callback: (result: any) => void): Promise<any>
  • post data via obniz REST api

    Parameters

    • json: any
    • callback: (result: any) => void
        • (result: any): void
        • Parameters

          • result: any

          Returns void

    Returns Promise<any>

Generated using TypeDoc