Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Methods

  • deleteData(queryParams?: DataQuery): Promise<string>
  • Delete data from device

    example
    const myDevice = new Device({ token: "my_device_token" });

    const result = await myDevice.deleteData({
    query: "last_item",
    variable: "humidity",
    value: 10
    });

    Parameters

    Returns Promise<string>

  • Edit data in a Mutable-type device.

    example
    const myDevice = new Device({ token: "my_device_token" });

    const result = await myDevice.editData({
    id: "id_of_the_data_item"
    value: 123,
    time: "2022-04-01 12:34:56",
    location: { lat: 42.2974279, lng: -85.628292 },
    });

    Parameters

    • data: DataEdit | DataEdit[]

      Array or object with the data to be edited, each object with the data's ID.

    Returns Promise<string>

    Success message with the amount of data items updated.

  • Get data from TagoIO Device.

    example
    const myDevice = new Device({ token: "my_device_token" });

    const result = await myDevice.getData({
    query: "last_item",
    variable: "humidity",
    });

    Parameters

    • Optional queryParams: DataQuery

      Object with query params

    Returns Promise<Data[]>

    An array of TagoIO registers

  • Get parameters from device

    example
    const myDevice = new Device({ token: "my_device_token" });

    const result = await myDevice.getParameters();

    Parameters

    • Optional onlyUnRead: boolean

      set true to get only unread parameters

    Returns Promise<ConfigurationParams[]>

  • Send data to device

    example
    const myDevice = new Device({ token: "my_device_token" });

    const result = await myDevice.sendData({
    variable: "temperature",
    unit: "F",
    value: 55,
    time: "2015-11-03 13:44:33",
    location: { lat: 42.2974279, lng: -85.628292 },
    });

    Parameters

    • data: DataCreate | DataCreate[]

      An array or one object with data to be send to TagoIO using device token

    Returns Promise<string>

  • Stream data to device

    experimental
    example
    const myDevice = new Device({ token: "my_device_token" });

    const data = [
    {
    variable: "temperature",
    unit: "F",
    value: 55,
    time: "2015-11-03 13:44:33",
    location: { lat: 42.2974279, lng: -85.628292 },
    },
    {
    variable: "temperature",
    unit: "F",
    value: 53,
    time: "2015-11-03 13:44:33",
    location: { lat: 43.2974279, lng: -86.628292 },
    },
    // ...
    ];

    const result = await myDevice.sendDataStreaming(data, {
    poolingRecordQty: 1000,
    poolingTime: 1000,
    });

    Parameters

    • data: DataCreate[]

      An array or one object with data to be send to TagoIO using device token

    • options: Omit<OptionsStreaming, "neverStop">

      Stream options

    Returns Promise<string>

  • setParameterAsRead(parameterID: string): Promise<string>
  • Mark parameter as read

    example
    const myDevice = new Device({ token: "my_device_token" });

    const result = await myDevice.setParameterAsRead("parameter_id");

    Parameters

    • parameterID: string

      Parameter identification

    Returns Promise<string>