1.1.13 • Published 8 months ago
iplayabc-speaker-iot-sdk v1.1.13
Huaweicloud & Azure Speaker IOT SDK
const platform = new CloudPlatform({
AK: process.env.AK,
SK: process.env.SK,
ENDPOINT: process.env.IOT_END_POINT,
APP_ID: process.env.APP_ID,
PRODUCT_ID: process.env.PRODUCT_ID,
PROJECT_ID: process.env.PROJECT_ID,
IAM_ENDPOINT: process.env.IAM_ENDPOINT,
IAM_USER: process.env.IAM_USER,
IAM_PWD: process.env.HUAWEI_IAM_PWD,
IAM_DOMAIN_ID: process.env.IAM_DOMAIN_ID,
IAM_DOMAIN_NAME: process.env.IAM_DOMAIN_NAME,
})
deviceId = 'my-device-v1-1234567890';
let deviceInfo = await platform.getDevice(deviceId)
// remove device if exists
if (deviceInfo!=null) {
await platform.removeDevice(deviceId)
deviceInfo = await platform.getDevice(deviceId)
}
// device should not exist
chai.expect(deviceInfo).to.be.null
// create device
const password = await platform.createDeviceWithToken({
deviceId
})
// password should be a string
chai.expect(password).to.be.a('string');
// get device info
deviceInfo = await platform.getDevice(deviceId)
// device should exist
chai.expect(deviceInfo).to.not.be.null
// remove device
const removed = await platform.removeDevice(deviceId)
chai.expect(removed).to.be.true
// device should not exist
deviceInfo = await platform.getDevice(deviceId)
chai.expect(deviceInfo).to.be.null
1.1.1
8 months ago
1.1.0
8 months ago
1.1.9
8 months ago
1.1.8
8 months ago
1.1.7
8 months ago
1.1.6
8 months ago
1.1.5
8 months ago
1.1.4
8 months ago
1.1.3
8 months ago
1.1.2
8 months ago
1.1.12
8 months ago
1.1.11
8 months ago
1.1.10
8 months ago
1.1.13
8 months ago
1.0.26
10 months ago
1.0.27
9 months ago
1.0.25
11 months ago
1.0.24
11 months ago
1.0.23
11 months ago
1.0.22
11 months ago
1.0.21
11 months ago
1.0.20
11 months ago
1.0.19
11 months ago
1.0.18
11 months ago
1.0.16
11 months ago
1.0.15
11 months ago
1.0.14
11 months ago
1.0.13
11 months ago
1.0.11
11 months ago
1.0.10
11 months ago
1.0.9
11 months ago
1.0.8
11 months ago
1.0.6
11 months ago
1.0.5
11 months ago
1.0.4
11 months ago
1.0.3
11 months ago
1.0.2
11 months ago
1.0.1
11 months ago
1.0.0
11 months ago