mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Update with new service features.
This commit is contained in:
parent
2379acae5d
commit
a915aea9ea
9 changed files with 440 additions and 109 deletions
|
@ -117,6 +117,65 @@ dbapi.setDeviceAbsent = function(serial) {
|
|||
}))
|
||||
}
|
||||
|
||||
dbapi.setDeviceAirplaneMode = function(serial, enabled) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
airplaneMode: enabled
|
||||
}))
|
||||
}
|
||||
|
||||
dbapi.setDeviceBattery = function(serial, battery) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
battery: {
|
||||
status: battery.status
|
||||
, health: battery.health
|
||||
, source: battery.source
|
||||
, level: battery.level
|
||||
, scale: battery.scale
|
||||
, temp: battery.temp
|
||||
, voltage: battery.voltage
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
dbapi.setDeviceBrowser = function(serial, browser) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
browser: {
|
||||
selected: browser.selected
|
||||
, apps: browser.apps
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
dbapi.setDeviceConnectivity = function(serial, connectivity) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
network: {
|
||||
connected: connectivity.connected
|
||||
, type: connectivity.type
|
||||
, subtype: connectivity.subtype
|
||||
, failover: !!connectivity.failover
|
||||
, roaming: !!connectivity.roaming
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
dbapi.setDevicePhoneState = function(serial, state) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
network: {
|
||||
state: state.state
|
||||
, manual: state.manual
|
||||
, operator: state.operator
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
dbapi.setDeviceRotation = function(serial, rotation) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
display: {
|
||||
orientation: rotation
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
dbapi.setDeviceChannel = function(serial, channel) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
channel: channel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue