mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Battery level and temp were not being sorted by their numeric values.
This commit is contained in:
@@ -218,6 +218,11 @@ module.exports = function DeviceColumnService($filter, gettext) {
|
||||
? Math.floor(device.battery.level / device.battery.scale * 100) + '%'
|
||||
: ''
|
||||
}
|
||||
, compare: function(deviceA, deviceB) {
|
||||
var va = deviceA.battery ? deviceA.battery.level : 0
|
||||
, vb = deviceB.battery ? deviceB.battery.level : 0
|
||||
return va - vb
|
||||
}
|
||||
})
|
||||
, batteryTemp: TextCell({
|
||||
title: gettext('Battery Temp')
|
||||
@@ -225,6 +230,11 @@ module.exports = function DeviceColumnService($filter, gettext) {
|
||||
, value: function(device) {
|
||||
return device.battery ? device.battery.temp + '°C' : ''
|
||||
}
|
||||
, compare: function(deviceA, deviceB) {
|
||||
var va = deviceA.battery ? deviceA.battery.temp : 0
|
||||
, vb = deviceB.battery ? deviceB.battery.temp : 0
|
||||
return va - vb
|
||||
}
|
||||
})
|
||||
, provider: TextCell({
|
||||
title: gettext('Location')
|
||||
|
||||
Reference in New Issue
Block a user