1.1.1 • Published 2 years ago

waziup v1.1.1

Weekly downloads
2
License
ISC
Repository
-
Last release
2 years ago

Waziup

This repository implements a client to call APIs of the Waziup Cloud and Wazigate platform.

Connect to the Waziup Cloud or to a Wazigate from a remote machine like this:

import * as waziup from "waziup";

main();

async function main() {

    // connect to the Wazigate (or the Cloud).
    var gateway = await waziup.connect({
        host: "wazigate.local", // a local Wazigate
        // host: "waziup.io", // or the Waziup Cloud
        username: "MyUsername",
        password: "MyPassword"
    });

    // read the devices list
    var devices = await gateway.getDevices();
    console.log(`We have ${devices.length} devices:`, devices);

    // rename a device
    gateway.setDeviceName(myDevice, "New Name :)");

    // upload a new sensor value
    var value = 47.5; // measurement value
    gateway.addSensorValues(myDevice, mySensor, value);
}

From inside a Waziup App things a little bit easier:

import * as waziup from "waziup";

main();

async function main() {

    // connect to the Wazigate
    var gateway = await waziup.connect();

    // read the Gateway ID
    var id = await gateway.getDeviceID();
    console.log(`This is Wazigate #${id}.`)

    // rename the gateway
    gateway.setDeviceName("New Gateway :)");

    // upload a new sensor value
    var value = 47.5; // measurement value
    gateway.addSensorValues(mySensor, value);
}
1.1.1

2 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago