mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 17:41:41 +01:00
Battery (Windows): detect cycle count
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include "modules/battery/battery.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
#define FF_BATTERY_NUM_FORMAT_ARGS 5
|
||||
#define FF_BATTERY_NUM_FORMAT_ARGS 7
|
||||
|
||||
static void printBattery(FFBatteryOptions* options, FFBatteryResult* result, uint8_t index)
|
||||
{
|
||||
@@ -70,6 +70,7 @@ static void printBattery(FFBatteryOptions* options, FFBatteryResult* result, uin
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &capacityStr},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result->status},
|
||||
{FF_FORMAT_ARG_TYPE_DOUBLE, &result->temperature},
|
||||
{FF_FORMAT_ARG_TYPE_UINT, &result->cycleCount},
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -215,6 +216,7 @@ void ffGenerateBatteryJsonResult(FFBatteryOptions* options, yyjson_mut_doc* doc,
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "status", &battery->status);
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "technology", &battery->technology);
|
||||
yyjson_mut_obj_add_real(doc, obj, "temperature", battery->temperature);
|
||||
yyjson_mut_obj_add_uint(doc, obj, "cycleCount", battery->cycleCount);
|
||||
}
|
||||
|
||||
FF_LIST_FOR_EACH(FFBatteryResult, battery, results)
|
||||
@@ -233,7 +235,9 @@ void ffPrintBatteryHelpFormat(void)
|
||||
"Battery model",
|
||||
"Battery technology",
|
||||
"Battery capacity (percentage)",
|
||||
"Battery status"
|
||||
"Battery status",
|
||||
"Battery temperature",
|
||||
"Battery cycle count",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user