1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-06 12:00:08 +02:00

Tell the UI why the device became unusable.

This commit is contained in:
Simo Kinnunen 2014-07-23 17:58:08 +09:00
parent d8dec38cad
commit 0ec8082ac1
3 changed files with 10 additions and 4 deletions

View file

@ -130,6 +130,7 @@ module.exports = function(options) {
, ready: false
, lastHeartbeatAt: null
, using: false
, likelyLeaveReason: 'device_absent'
}
})
})
@ -139,6 +140,7 @@ module.exports = function(options) {
, data: datautil.applyOwner({
serial: message.serial
, owner: message.owner
, likelyLeaveReason: 'owner_change'
}
, user
)
@ -150,12 +152,14 @@ module.exports = function(options) {
, data: datautil.applyOwner({
serial: message.serial
, owner: null
, likelyLeaveReason: message.reason
}
, user
)
})
})
.on(wire.DeviceStatusMessage, function(channel, message) {
message.likelyLeaveReason = 'status_change'
socket.emit('device.change', {
important: true
, data: message