| 5.25.1 |
2024-01-05 |
diff --git a/docs/index.html b/docs/index.html
index ff9e2d5..f5141e9 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -170,7 +170,7 @@
systeminformation
- 3New Version: 5.25.1
+ 3New Version: 5.25.2
diff --git a/lib/battery.js b/lib/battery.js
index c61ec3b..eced143 100644
--- a/lib/battery.js
+++ b/lib/battery.js
@@ -181,7 +181,7 @@ module.exports = function (callback) {
}
if (_darwin) {
- exec('ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|BatterySerialNumber|TimeRemaining|Voltage"; pmset -g batt | grep %', function (error, stdout) {
+ exec('ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|DeviceName|BatterySerialNumber|Serial|TimeRemaining|Voltage"; pmset -g batt | grep %', function (error, stdout) {
if (stdout) {
let lines = stdout.toString().replace(/ +/g, '').replace(/"+/g, '').replace(/-/g, '').split('\n');
result.cycleCount = parseInt('0' + util.getValue(lines, 'cyclecount', '='), 10);
@@ -191,7 +191,8 @@ module.exports = function (callback) {
result.currentCapacity = Math.round(parseInt('0' + util.getValue(lines, 'applerawcurrentcapacity', '='), 10) * (result.voltage || 1));
result.designedCapacity = Math.round(parseInt('0' + util.getValue(lines, 'DesignCapacity', '='), 10) * (result.voltage || 1));
result.manufacturer = 'Apple';
- result.serial = util.getValue(lines, 'BatterySerialNumber', '=');
+ result.serial = util.getValue(lines, 'BatterySerialNumber', '=') || util.getValue(lines, 'Serial', '=');
+ result.model = util.getValue(lines, 'DeviceName', '=');
let percent = null;
const line = util.getValue(lines, 'internal', 'Battery');
let parts = line.split(';');
diff --git a/lib/cpu.js b/lib/cpu.js
index bd060d9..27ca728 100644
--- a/lib/cpu.js
+++ b/lib/cpu.js
@@ -1019,7 +1019,7 @@ function getCpuCurrentSpeedSync() {
if (speeds[i] < minFreq) { minFreq = speeds[i]; }
cores.push(parseFloat(speeds[i].toFixed(2)));
}
- avgFreq = avgFreq / cpus.length;
+ avgFreq = avgFreq / speeds.length;
return {
min: parseFloat(minFreq.toFixed(2)),
max: parseFloat(maxFreq.toFixed(2)),
diff --git a/lib/system.js b/lib/system.js
index f982ea8..4abc938 100644
--- a/lib/system.js
+++ b/lib/system.js
@@ -48,11 +48,11 @@ function system(callback) {
if (_linux || _freebsd || _openbsd || _netbsd) {
exec('export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL', function (error, stdout) {
let lines = stdout.toString().split('\n');
- result.manufacturer = util.getValue(lines, 'manufacturer');
- result.model = util.getValue(lines, 'product name');
+ result.manufacturer = cleanDefaults(util.getValue(lines, 'manufacturer'));
+ result.model = cleanDefaults(util.getValue(lines, 'product name'));
result.version = cleanDefaults(util.getValue(lines, 'version'));
result.serial = cleanDefaults(util.getValue(lines, 'serial number'));
- result.uuid = cleanDefaults((util.getValue(lines, 'uuid').toLowerCase()));
+ result.uuid = cleanDefaults((util.getValue(lines, 'uuid'))).toLowerCase();
result.sku = cleanDefaults(util.getValue(lines, 'sku number'));
// Non-Root values
const cmd = `echo -n "product_name: "; cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null; echo;