twonet
v3.0.0
Published
A Node implementation of the Qualcomm Life 2net API.
Downloads
3
Maintainers
Readme
TwoNetAPI
An npm module that implements the Qualcomm Life 2net API. This implementation currently supports revision Y of the API.
Methods
getHubs()
getHub()
activateHub()
deactiveHub()
activateHubStatus()
activateDevice()
deactivateDevice()
getDevice()
getDevices()
createDevice()
registerDevice()
associateDevice()
deviceCommand()
deviceCommandStatus()
updateDevicePassthrough()
Installation
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:
npm run help
Usage
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);
});
});