mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Use WebSockets for the screen. The screen directive works, but needs a serious cleanup.
This commit is contained in:
parent
5114a50992
commit
e4114d87af
30 changed files with 350 additions and 247 deletions
|
@ -4,19 +4,19 @@ var logger = require('../../../util/logger')
|
|||
|
||||
module.exports = syrup.serial()
|
||||
.dependency(require('./service'))
|
||||
.dependency(require('./http'))
|
||||
.define(function(options, service, http) {
|
||||
.dependency(require('./screen'))
|
||||
.define(function(options, service, screen) {
|
||||
var log = logger.createLogger('device:plugins:display')
|
||||
|
||||
function fetch() {
|
||||
log.info('Fetching display info')
|
||||
return service.getDisplay(0)
|
||||
.catch(function() {
|
||||
log.info('Falling back to HTTP API')
|
||||
return http.getDisplay(0)
|
||||
log.info('Falling back to screen API')
|
||||
return screen.info(0)
|
||||
})
|
||||
.then(function(display) {
|
||||
display.url = http.getDisplayUrl(display.id)
|
||||
display.url = screen.publicUrl
|
||||
return display
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue