feat(server,module): add cast module
This commit is contained in:
21
pkg/module/cast/testdata/cast.js
vendored
Normal file
21
pkg/module/cast/testdata/cast.js
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
cast.refreshDevices('5s')
|
||||
.then(function(devices) {
|
||||
console.log(devices)
|
||||
|
||||
if (devices === null) {
|
||||
throw new Error("devices should not be null");
|
||||
}
|
||||
|
||||
if (devices.length === 0) {
|
||||
throw new Error("devices.length should not be 0");
|
||||
}
|
||||
|
||||
return devices
|
||||
})
|
||||
.then(function(devices) {
|
||||
return cast.getStatus(devices[0].uuid)
|
||||
})
|
||||
.then(function(status) {
|
||||
console.log(status)
|
||||
})
|
6
pkg/module/cast/testdata/refresh_devices.js
vendored
Normal file
6
pkg/module/cast/testdata/refresh_devices.js
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
function refreshDevices() {
|
||||
return cast.refreshDevices('5s')
|
||||
.then(function(devices) {
|
||||
return devices
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user