mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 09:53:21 +02:00
Reaper decides if a device is present or not. Allows devices to "come back to life" if they start beating again.
This commit is contained in:
@@ -54,8 +54,8 @@ module.exports = function(options) {
|
||||
|
||||
devDealer.on('message', wirerouter()
|
||||
// Initial device message
|
||||
.on(wire.DevicePresentMessage, function(channel, message, data) {
|
||||
dbapi.saveDevice(message.serial, message)
|
||||
.on(wire.DeviceIntroductionMessage, function(channel, message, data) {
|
||||
dbapi.saveDeviceInitialState(message.serial, message)
|
||||
.then(function() {
|
||||
devDealer.send([
|
||||
message.provider.channel
|
||||
@@ -67,6 +67,10 @@ module.exports = function(options) {
|
||||
})
|
||||
})
|
||||
// Workerless messages
|
||||
.on(wire.DevicePresentMessage, function(channel, message, data) {
|
||||
dbapi.setDevicePresent(message.serial)
|
||||
appDealer.send([channel, data])
|
||||
})
|
||||
.on(wire.DeviceAbsentMessage, function(channel, message, data) {
|
||||
dbapi.setDeviceAbsent(message.serial)
|
||||
appDealer.send([channel, data])
|
||||
|
||||
Reference in New Issue
Block a user