mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Better device present/absent handling by separating it from the status event.
This commit is contained in:
parent
f432dc9fb9
commit
2086d7d439
9 changed files with 147 additions and 39 deletions
|
@ -32,6 +32,18 @@ module.exports = function(options) {
|
|||
})
|
||||
|
||||
devDealer.on('message', wirerouter()
|
||||
.on(wire.DevicePresentMessage, function(channel, message, data) {
|
||||
dbapi.saveDevice(message.serial, message)
|
||||
appDealer.send([channel, data])
|
||||
})
|
||||
.on(wire.DeviceAbsentMessage, function(channel, message, data) {
|
||||
dbapi.setDeviceAbsent(message.serial)
|
||||
appDealer.send([channel, data])
|
||||
})
|
||||
.on(wire.DeviceStatusMessage, function(channel, message, data) {
|
||||
dbapi.saveDeviceStatus(message.serial, message.status)
|
||||
appDealer.send([channel, data])
|
||||
})
|
||||
.on(wire.JoinGroupMessage, function(channel, message, data) {
|
||||
appDealer.send([channel, data])
|
||||
})
|
||||
|
@ -51,9 +63,6 @@ module.exports = function(options) {
|
|||
.on(wire.DeviceIdentityMessage, function(channel, message) {
|
||||
dbapi.saveDeviceIdentity(message.serial, message)
|
||||
})
|
||||
.on(wire.DeviceStatusMessage, function(channel, message) {
|
||||
dbapi.saveDeviceStatus(message.serial, message)
|
||||
})
|
||||
.on(wire.ShellCommandDataMessage, function(channel, message, data) {
|
||||
appDealer.send([channel, data])
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue