feat(server,module): add cast module

This commit is contained in:
2023-02-17 10:38:45 +01:00
parent 81dc1adfef
commit 3e601272d7
13 changed files with 729 additions and 3 deletions

21
pkg/module/cast/testdata/cast.js vendored Normal file
View 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)
})

View File

@ -0,0 +1,6 @@
function refreshDevices() {
return cast.refreshDevices('5s')
.then(function(devices) {
return devices
})
}