wifi.io sdk 
wifi.io node.js sdk

How to install
$ npm install wifi
Sample code
require wifi.io
var Wifi = require('wifi');
var wifi = new Wifi({
username: 'xxx',
password: 'xxx'
});
users api
wifi.user.login(function(err,result){
console.log(result);
});
wifi.user.logout(function(err,result){
console.log(result)
});
wifi.user.devices({
status: 0 ,
page: 1,
pagesize: 10
},function(err,result){
console.log(result)
});
device api
wifi.device.command({
did: 123,
method: 'reboot',
params: {}
},function(err,result){
console.log(result);
});
data apis
wifi.data.get({
tags: '123',
starttime: 0,
endtime: 100,
filter: '(3,9]',
simplify: false,
page: 1,
pagesize: 10,
method: 'reboot',
params: {}
},function(err,result){
console.log(result);
});
wifi.data.getByKey({
key: '123',
},function(err,result){
console.log(result);
});
wifi.data.insert({
tags: '123',
value: 123 ,
},function(err,result){
console.log(result);
});
Local scanner supported
var local = new Wifi().scan();
local.device.command({
method: 'reboot',
params: {}
},function(err,result){
console.log(result);
});
Pull Request Welcome !
- fork this repo
- feel free to add your feature
- make sure your feature are fully tested!
- send me a PR, and enjoy !
Run unit-test (Mocha)
$ git clone https://github.com/turingou/beer.git
$ cd beer
$ npm install // will install mocha localy
$ npm test