mirror of
https://github.com/openstf/stf
synced 2025-10-04 02:09:32 +02:00
Use automation state for devices used by api
This commit is contained in:
parent
42b55889ae
commit
a62a6094e4
11 changed files with 45 additions and 10 deletions
|
@ -153,6 +153,7 @@ dbapi.saveDeviceInitialState = function(serial, device) {
|
|||
, reverseForwards: []
|
||||
, remoteConnect: false
|
||||
, remoteConnectUrl: null
|
||||
, usage: null
|
||||
}
|
||||
return db.run(r.table('devices').get(serial).update(data))
|
||||
.then(function(stats) {
|
||||
|
@ -212,6 +213,20 @@ dbapi.setDeviceAbsent = function(serial) {
|
|||
}))
|
||||
}
|
||||
|
||||
dbapi.setDeviceUsage = function(serial, usage) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
usage: usage
|
||||
, usageChangedAt: r.now()
|
||||
}))
|
||||
}
|
||||
|
||||
dbapi.unsetDeviceUsage = function(serial) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
usage: null
|
||||
, usageChangedAt: r.now()
|
||||
}))
|
||||
}
|
||||
|
||||
dbapi.setDeviceAirplaneMode = function(serial, enabled) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
airplaneMode: enabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue