0.1.0 • Published 6 years ago
yun-iot v0.1.0
yunIOT 物联网服务 node SDK
目前根据业务需求暂更新部分功能
1. 下载
npm install yun-iot
or
yarn add yun-iot
2. 使用
const IOT = require('yun-iot');
var client = new IOT({
host: 'http://iot-i.cn' // 默认值
port: '6690' // 默认值
})
async function main() {
const token = (await client.login({
username: 'test',
password: 'test',
})).token
console.log('token', token);
const devices = await client.findUserDevices(token)
console.log('devices', devices);
const testId = devices.devices[0].deviceid;
console.log('testId', testId);
const status = await client.getDeviceStatus(testId, token)
console.log('status', status);
}
main()
0.1.0
6 years ago