twonet
Version:
A Node implementation of the Qualcomm Life 2net API.
54 lines (43 loc) • 1.03 kB
Markdown
An npm module that implements the Qualcomm Life 2net API. This implementation currently supports revision Y of the API.
```js
getHubs()
getHub()
activateHub()
deactiveHub()
activateHubStatus()
activateDevice()
deactivateDevice()
getDevice()
getDevices()
createDevice()
registerDevice()
associateDevice()
deviceCommand()
deviceCommandStatus()
updateDevicePassthrough()
```
## Installation
```shell
npm install twonet
```
## Running utility scripts
The package provides several scripts for common tasks used with a fleet of hubs.
Before using the CLI, add your customer_id and auth_key to the lib/config.js file.
A list of available CLI commands:
```shell
npm run help
```
## Usage
```js
var api = new TwoNetAPI(YOUR_CUST_ID, YOUR_AUTH_KEY, REGION, ENV);
api.getHubs(function(status, hubs) {
if( status < 0 ) {
console.log('Failed api.getHubs() : ' + status);
}
hubs.forEach(function(h) {
console.dir(h);
});
});
```