mirror of
https://github.com/morgan9e/gnome-shell-extension-freon
synced 2026-04-14 00:14:14 +09:00
Prevented pushing of non-numeric temperature reports from hddtemp, such as for flash drives
This commit is contained in:
@@ -155,7 +155,9 @@ function parseHddTempOutput(txt, sep) {
|
||||
let fields = line.split(sep).filter(function(e){ return e; });
|
||||
sensor['label'] = _('Drive %s').format(fields[0].split('/').pop());
|
||||
sensor['temp'] = parseFloat(fields[2]);
|
||||
sensors.push(sensor);
|
||||
//push only if the temp is a Number
|
||||
if (!isNaN(sensor['temp']))
|
||||
sensors.push(sensor);
|
||||
}
|
||||
return sensors;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user